FreeBSD Bugzilla – Attachment 13773 Details for
Bug 26068
[Fix] mountd with ipv4 only
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.55 KB, created by
mb
on 2001-03-25 14:00:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
mb
Created:
2001-03-25 14:00:00 UTC
Size:
2.55 KB
patch
obsolete
>--- sbin/mountd/mountd.c Mon Mar 19 13:50:01 2001 >+++ sbin/mountd/mountd.c Sat Mar 24 13:02:25 2001 >@@ -352,27 +352,29 @@ > rpcb_unset(RPCPROG_MNT, RPCMNT_VER3, NULL); > udpsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); > tcpsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); >- udp6sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); >- tcp6sock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); >+ udpconf = getnetconfigent("udp"); >+ tcpconf = getnetconfigent("tcp"); >+ if (have_v6) { >+ udp6sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); >+ tcp6sock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); > /* > * We're doing host-based access checks here, so don't allow > * v4-in-v6 to confuse things. The kernel will disable it > * by default on NFS sockets too. > */ >- if (udp6sock != -1 && setsockopt(udp6sock, IPPROTO_IPV6, >- IPV6_BINDV6ONLY, &one, sizeof one) < 0){ >- syslog(LOG_ERR, "can't disable v4-in-v6 on UDP socket"); >- exit(1); >- } >- if (tcp6sock != -1 && setsockopt(tcp6sock, IPPROTO_IPV6, >- IPV6_BINDV6ONLY, &one, sizeof one) < 0){ >- syslog(LOG_ERR, "can't disable v4-in-v6 on UDP socket"); >- exit(1); >+ if (udp6sock != -1 && setsockopt(udp6sock, IPPROTO_IPV6, >+ IPV6_BINDV6ONLY, &one, sizeof one) < 0){ >+ syslog(LOG_ERR, "can't disable v4-in-v6 on UDP socket"); >+ exit(1); >+ } >+ if (tcp6sock != -1 && setsockopt(tcp6sock, IPPROTO_IPV6, >+ IPV6_BINDV6ONLY, &one, sizeof one) < 0){ >+ syslog(LOG_ERR, "can't disable v4-in-v6 on UDP socket"); >+ exit(1); >+ } >+ udp6conf = getnetconfigent("udp6"); >+ tcp6conf = getnetconfigent("tcp6"); > } >- udpconf = getnetconfigent("udp"); >- tcpconf = getnetconfigent("tcp"); >- udp6conf = getnetconfigent("udp6"); >- tcp6conf = getnetconfigent("tcp6"); > if (!resvport_only) { > mib[0] = CTL_VFS; > mib[1] = vfc.vfc_typenum; >@@ -429,7 +431,7 @@ > syslog(LOG_WARNING, "can't create TCP service"); > > } >- if (udp6sock != -1 && udp6conf != NULL) { >+ if (have_v6 && udp6sock != -1 && udp6conf != NULL) { > bindresvport(udp6sock, NULL); > udp6transp = svc_dg_create(udp6sock, 0, 0); > if (udp6transp != NULL) { >@@ -449,7 +451,7 @@ > syslog(LOG_WARNING, "can't create UDP6 service"); > > } >- if (tcp6sock != -1 && tcp6conf != NULL) { >+ if (have_v6 && tcp6sock != -1 && tcp6conf != NULL) { > bindresvport(tcp6sock, NULL); > listen(tcp6sock, SOMAXCONN); > tcp6transp = svc_vc_create(tcp6sock, 0, 0); >@@ -2502,7 +2504,7 @@ > { > close(mountdlockfd); > unlink(MOUNTDLOCK); >- pmap_unset(RPCPROG_MNT, 1); >- pmap_unset(RPCPROG_MNT, 3); >+ rpcb_unset(RPCPROG_MNT, RPCMNT_VER1, NULL); >+ rpcb_unset(RPCPROG_MNT, RPCMNT_VER3, NULL); > exit (0); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 26068
: 13773