diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 532425db11fe..1334fc174bcf 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -539,12 +539,15 @@ done: | |||
539 | case IPV6_MULTICAST_IF: | 539 | case IPV6_MULTICAST_IF: |
540 | if (sk->sk_type == SOCK_STREAM) | 540 | if (sk->sk_type == SOCK_STREAM) |
541 | goto e_inval; | 541 | goto e_inval; |
542 | if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) | ||
543 | goto e_inval; | ||
544 | 542 | ||
545 | if (__dev_get_by_index(&init_net, val) == NULL) { | 543 | if (val) { |
546 | retv = -ENODEV; | 544 | if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) |
547 | break; | 545 | goto e_inval; |
546 | |||
547 | if (__dev_get_by_index(&init_net, val) == NULL) { | ||
548 | retv = -ENODEV; | ||
549 | break; | ||
550 | } | ||
548 | } | 551 | } |
549 | np->mcast_oif = val; | 552 | np->mcast_oif = val; |
550 | retv = 0; | 553 | retv = 0; |