From d658ddc7c7924a861425fc3baf2c691390228d4a Mon Sep 17 00:00:00 2001 From: attilio Date: Fri, 24 Sep 2010 14:38:54 +0000 Subject: [PATCH] IP_BINDANY is not correctly handled in getsockopt() case. Fix it by specifying the correct bits. Sponsored by: Sandvine Incorporated Reviewed by: bz, emaste, rstone Obtained from: Sandvine Incorporated MFC after: 10 days --- sys/netinet/ip_output.c | 4 ++++ sys/netinet6/ip6_output.c | 1 + 2 files changed, 5 insertions(+) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 1a933c51fd9f..e292b606346e 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1121,6 +1121,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) case IP_FAITH: case IP_ONESBCAST: case IP_DONTFRAG: + case IP_BINDANY: switch (sopt->sopt_name) { case IP_TOS: @@ -1176,6 +1177,9 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) case IP_DONTFRAG: optval = OPTBIT(INP_DONTFRAG); break; + case IP_BINDANY: + optval = OPTBIT(INP_BINDANY); + break; } error = sooptcopyout(sopt, &optval, sizeof optval); break; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 2c30b278e776..58853acdcd30 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1823,6 +1823,7 @@ do { \ case IPV6_PORTRANGE: case IPV6_RECVTCLASS: case IPV6_AUTOFLOWLABEL: + case IPV6_BINDANY: switch (optname) { case IPV6_RECVHOPOPTS: