|
Lines 256-262
Link Here
|
| 256 |
ip6flag = 1; |
256 |
ip6flag = 1; |
| 257 |
s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); |
257 |
s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); |
| 258 |
if (s < 0 && (errno == EPROTONOSUPPORT || |
258 |
if (s < 0 && (errno == EPROTONOSUPPORT || |
| 259 |
errno == EPFNOSUPPORT || errno == EAFNOSUPPORT)) |
259 |
errno == EPFNOSUPPORT || errno == EAFNOSUPPORT) || |
|
|
260 |
(getnetconfigent("udp6") == NULL && getnetconfigent("tcp6") == NULL)) |
| 260 |
ip6flag = 0; |
261 |
ip6flag = 0; |
| 261 |
else |
262 |
else |
| 262 |
close(s); |
263 |
close(s); |
|
Lines 548-559
Link Here
|
| 548 |
} |
549 |
} |
| 549 |
nconf_udp = getnetconfigent("udp"); |
550 |
nconf_udp = getnetconfigent("udp"); |
| 550 |
if (nconf_udp == NULL) |
551 |
if (nconf_udp == NULL) |
| 551 |
err(1, "getnetconfigent udp failed"); |
552 |
syslog(LOG_ERR, "getnetconfigent udp failed"); |
| 552 |
nb_udp.buf = ai_udp->ai_addr; |
553 |
else { |
| 553 |
nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen; |
554 |
nb_udp.buf = ai_udp->ai_addr; |
| 554 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_udp, &nb_udp)) || |
555 |
nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen; |
| 555 |
(!rpcb_set(RPCPROG_NFS, 3, nconf_udp, &nb_udp))) |
556 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_udp, |
| 556 |
err(1, "rpcb_set udp failed"); |
557 |
&nb_udp)) || (!rpcb_set(RPCPROG_NFS, 3, |
|
|
558 |
nconf_udp, &nb_udp))) |
| 559 |
syslog(LOG_ERR, "rpcb_set udp failed"); |
| 560 |
} |
| 557 |
freeaddrinfo(ai_udp); |
561 |
freeaddrinfo(ai_udp); |
| 558 |
} |
562 |
} |
| 559 |
} |
563 |
} |
|
Lines 618-629
Link Here
|
| 618 |
} |
622 |
} |
| 619 |
nconf_udp6 = getnetconfigent("udp6"); |
623 |
nconf_udp6 = getnetconfigent("udp6"); |
| 620 |
if (nconf_udp6 == NULL) |
624 |
if (nconf_udp6 == NULL) |
| 621 |
err(1, "getnetconfigent udp6 failed"); |
625 |
syslog(LOG_ERR, "getnetconfigent udp6 failed"); |
| 622 |
nb_udp6.buf = ai_udp6->ai_addr; |
626 |
else { |
| 623 |
nb_udp6.len = nb_udp6.maxlen = ai_udp6->ai_addrlen; |
627 |
nb_udp6.buf = ai_udp6->ai_addr; |
| 624 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_udp6, &nb_udp6)) || |
628 |
nb_udp6.len = nb_udp6.maxlen; |
| 625 |
(!rpcb_set(RPCPROG_NFS, 3, nconf_udp6, &nb_udp6))) |
629 |
nb_udp6.len = ai_udp6->ai_addrlen; |
| 626 |
err(1, "rpcb_set udp6 failed"); |
630 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_udp6, |
|
|
631 |
&nb_udp6)) || (!rpcb_set(RPCPROG_NFS, 3, |
| 632 |
nconf_udp6, &nb_udp6))) |
| 633 |
syslog(LOG_ERR, "rpcb_set udp6 failed"); |
| 634 |
} |
| 627 |
freeaddrinfo(ai_udp6); |
635 |
freeaddrinfo(ai_udp6); |
| 628 |
} |
636 |
} |
| 629 |
} |
637 |
} |
|
Lines 684-696
Link Here
|
| 684 |
} |
692 |
} |
| 685 |
nconf_tcp = getnetconfigent("tcp"); |
693 |
nconf_tcp = getnetconfigent("tcp"); |
| 686 |
if (nconf_tcp == NULL) |
694 |
if (nconf_tcp == NULL) |
| 687 |
err(1, "getnetconfigent tcp failed"); |
695 |
syslog(LOG_ERR, "getnetconfigent tcp failed"); |
| 688 |
nb_tcp.buf = ai_tcp->ai_addr; |
696 |
else { |
| 689 |
nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen; |
697 |
nb_tcp.buf = ai_tcp->ai_addr; |
| 690 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_tcp, |
698 |
nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen; |
| 691 |
&nb_tcp)) || (!rpcb_set(RPCPROG_NFS, 3, |
699 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_tcp, |
| 692 |
nconf_tcp, &nb_tcp))) |
700 |
&nb_tcp)) || (!rpcb_set(RPCPROG_NFS, 3, |
| 693 |
err(1, "rpcb_set tcp failed"); |
701 |
nconf_tcp, &nb_tcp))) |
|
|
702 |
syslog(LOG_ERR, "rpcb_set tcp failed"); |
| 703 |
} |
| 694 |
freeaddrinfo(ai_tcp); |
704 |
freeaddrinfo(ai_tcp); |
| 695 |
} |
705 |
} |
| 696 |
} |
706 |
} |
|
Lines 759-770
Link Here
|
| 759 |
} |
769 |
} |
| 760 |
nconf_tcp6 = getnetconfigent("tcp6"); |
770 |
nconf_tcp6 = getnetconfigent("tcp6"); |
| 761 |
if (nconf_tcp6 == NULL) |
771 |
if (nconf_tcp6 == NULL) |
| 762 |
err(1, "getnetconfigent tcp6 failed"); |
772 |
syslog(LOG_ERR, "getnetconfigent tcp6 failed"); |
| 763 |
nb_tcp6.buf = ai_tcp6->ai_addr; |
773 |
else { |
| 764 |
nb_tcp6.len = nb_tcp6.maxlen = ai_tcp6->ai_addrlen; |
774 |
nb_tcp6.buf = ai_tcp6->ai_addr; |
| 765 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_tcp6, &nb_tcp6)) || |
775 |
nb_tcp6.len = nb_tcp6.maxlen; |
| 766 |
(!rpcb_set(RPCPROG_NFS, 3, nconf_tcp6, &nb_tcp6))) |
776 |
nb_tcp6.len = ai_tcp6->ai_addrlen; |
| 767 |
err(1, "rpcb_set tcp6 failed"); |
777 |
if ((!rpcb_set(RPCPROG_NFS, 2, nconf_tcp6, |
|
|
778 |
&nb_tcp6)) || (!rpcb_set(RPCPROG_NFS, |
| 779 |
3, nconf_tcp6, &nb_tcp6))) |
| 780 |
syslog(LOG_ERR, "rpcb_set tcp6 failed"); |
| 781 |
} |
| 768 |
freeaddrinfo(ai_tcp6); |
782 |
freeaddrinfo(ai_tcp6); |
| 769 |
} |
783 |
} |
| 770 |
} |
784 |
} |