Commit fdf1923b authored by Miaohe Lin's avatar Miaohe Lin Committed by David S. Miller

net: Remove duplicated midx check against 0

Check midx against 0 is always equal to check midx against sk_bound_dev_if
when sk_bound_dev_if is known not equal to 0 in these case.
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0ce779a9
...@@ -1124,8 +1124,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, int optname, ...@@ -1124,8 +1124,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, int optname,
dev_put(dev); dev_put(dev);
err = -EINVAL; err = -EINVAL;
if (sk->sk_bound_dev_if && if (sk->sk_bound_dev_if && midx != sk->sk_bound_dev_if)
(!midx || midx != sk->sk_bound_dev_if))
break; break;
inet->uc_index = ifindex; inet->uc_index = ifindex;
...@@ -1189,7 +1188,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, int optname, ...@@ -1189,7 +1188,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, int optname,
err = -EINVAL; err = -EINVAL;
if (sk->sk_bound_dev_if && if (sk->sk_bound_dev_if &&
mreq.imr_ifindex != sk->sk_bound_dev_if && mreq.imr_ifindex != sk->sk_bound_dev_if &&
(!midx || midx != sk->sk_bound_dev_if)) midx != sk->sk_bound_dev_if)
break; break;
inet->mc_index = mreq.imr_ifindex; inet->mc_index = mreq.imr_ifindex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment