Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111608081
D36429.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D36429.diff
View Options
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1313,10 +1313,6 @@
ip_rsvp_init(struct socket *so)
{
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
if (V_ip_rsvpd != NULL)
return EADDRINUSE;
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -686,11 +686,7 @@
ip_mrouter_init(struct socket *so, int version)
{
- CTR3(KTR_IPMF, "%s: so_type %d, pr_protocol %d", __func__,
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_IGMP)
- return EOPNOTSUPP;
+ CTR2(KTR_IPMF, "%s: so %p", __func__, so);
if (version != 1)
return ENOPROTOOPT;
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -693,6 +693,8 @@
error = priv_check(curthread, PRIV_NETINET_MROUTE);
if (error != 0)
return (error);
+ if (inp->inp_ip_p != IPPROTO_IGMP)
+ return (EOPNOTSUPP);
error = ip_mrouter_get ? ip_mrouter_get(so, sopt) :
EOPNOTSUPP;
break;
@@ -747,6 +749,8 @@
error = priv_check(curthread, PRIV_NETINET_MROUTE);
if (error != 0)
return (error);
+ if (inp->inp_ip_p != IPPROTO_RSVP)
+ return (EOPNOTSUPP);
error = ip_rsvp_init(so);
break;
@@ -762,6 +766,8 @@
error = priv_check(curthread, PRIV_NETINET_MROUTE);
if (error != 0)
return (error);
+ if (inp->inp_ip_p != IPPROTO_RSVP)
+ return (EOPNOTSUPP);
error = ip_rsvp_vif ?
ip_rsvp_vif(so, sopt) : EINVAL;
break;
@@ -781,6 +787,8 @@
error = priv_check(curthread, PRIV_NETINET_MROUTE);
if (error != 0)
return (error);
+ if (inp->inp_ip_p != IPPROTO_IGMP)
+ return (EOPNOTSUPP);
error = ip_mrouter_set ? ip_mrouter_set(so, sopt) :
EOPNOTSUPP;
break;
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -555,12 +555,7 @@
ip6_mrouter_init(struct socket *so, int v, int cmd)
{
- MRT6_DLOG(DEBUG_ANY, "so_type = %d, pr_protocol = %d",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_ICMPV6)
- return (EOPNOTSUPP);
+ MRT6_DLOG(DEBUG_ANY, "%s: socket %p", __func__, so);
if (v != 1)
return (ENOPROTOOPT);
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -2451,8 +2451,7 @@
* values or -1 as a special value.
*/
error = EINVAL;
- } else if (so->so_proto->pr_protocol ==
- IPPROTO_ICMPV6) {
+ } else if (inp->inp_ip_p == IPPROTO_ICMPV6) {
if (optval != icmp6off)
error = EINVAL;
} else
@@ -2460,7 +2459,7 @@
break;
case SOPT_GET:
- if (so->so_proto->pr_protocol == IPPROTO_ICMPV6)
+ if (inp->inp_ip_p == IPPROTO_ICMPV6)
optval = icmp6off;
else
optval = inp->in6p_cksum;
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -596,7 +596,7 @@
int
rip6_ctloutput(struct socket *so, struct sockopt *sopt)
{
- struct inpcb *inp;
+ struct inpcb *inp = sotoinpcb(so);
int error;
if (sopt->sopt_level == IPPROTO_ICMPV6)
@@ -608,7 +608,6 @@
else if (sopt->sopt_level != IPPROTO_IPV6) {
if (sopt->sopt_level == SOL_SOCKET &&
sopt->sopt_name == SO_SETFIB) {
- inp = sotoinpcb(so);
INP_WLOCK(inp);
inp->inp_inc.inc_fibnum = so->so_fibnum;
INP_WUNLOCK(inp);
@@ -629,6 +628,8 @@
case MRT6_ADD_MFC:
case MRT6_DEL_MFC:
case MRT6_PIM:
+ if (inp->inp_ip_p != IPPROTO_ICMPV6)
+ return (EOPNOTSUPP);
error = ip6_mrouter_get ? ip6_mrouter_get(so, sopt) :
EOPNOTSUPP;
break;
@@ -650,6 +651,8 @@
case MRT6_ADD_MFC:
case MRT6_DEL_MFC:
case MRT6_PIM:
+ if (inp->inp_ip_p != IPPROTO_ICMPV6)
+ return (EOPNOTSUPP);
error = ip6_mrouter_set ? ip6_mrouter_set(so, sopt) :
EOPNOTSUPP;
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 6, 11:05 PM (15 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17021208
Default Alt Text
D36429.diff (4 KB)
Attached To
Mode
D36429: raw ip: fix regression with multicast and RSVP
Attached
Detach File
Event Timeline
Log In to Comment