Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151396864
D30539.id90220.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30539.id90220.diff
View Options
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -321,8 +321,15 @@
struct sockaddr_in *sinp;
sinp = (struct sockaddr_in *)nam;
- if (nam->sa_family != AF_INET)
- return (EAFNOSUPPORT);
+ if (nam->sa_family != AF_INET) {
+ /*
+ * Preserve compatibility with old programs.
+ */
+ if (nam->sa_family != AF_UNSPEC ||
+ sinp->sin_addr.s_addr != INADDR_ANY)
+ return (EAFNOSUPPORT);
+ nam->sa_family = AF_INET;
+ }
if (nam->sa_len != sizeof(*sinp))
return (EINVAL);
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1622,14 +1622,23 @@
{
struct inpcb *inp;
struct inpcbinfo *pcbinfo;
+ struct sockaddr_in *sinp;
int error;
pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_bind: inp == NULL"));
- if (nam->sa_family != AF_INET)
- return (EAFNOSUPPORT);
+ sinp = (struct sockaddr_in *)nam;
+ if (nam->sa_family != AF_INET) {
+ /*
+ * Preserve compatibility with old programs.
+ */
+ if (nam->sa_family != AF_UNSPEC ||
+ sinp->sin_addr.s_addr != INADDR_ANY)
+ return (EAFNOSUPPORT);
+ nam->sa_family = AF_INET;
+ }
if (nam->sa_len != sizeof(struct sockaddr_in))
return (EINVAL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 9, 3:49 AM (13 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31132414
Default Alt Text
D30539.id90220.diff (1 KB)
Attached To
Mode
D30539: tcp, udp: Permit binding with AF_UNSPEC if the address is INADDR_ANY
Attached
Detach File
Event Timeline
Log In to Comment