forked from luck/tmp_suning_uos_patched
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: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0ce779a9f5
commit
fdf1923bf9
|
@ -1124,8 +1124,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, int optname,
|
|||
dev_put(dev);
|
||||
|
||||
err = -EINVAL;
|
||||
if (sk->sk_bound_dev_if &&
|
||||
(!midx || midx != sk->sk_bound_dev_if))
|
||||
if (sk->sk_bound_dev_if && midx != sk->sk_bound_dev_if)
|
||||
break;
|
||||
|
||||
inet->uc_index = ifindex;
|
||||
|
@ -1189,7 +1188,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, int optname,
|
|||
err = -EINVAL;
|
||||
if (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;
|
||||
|
||||
inet->mc_index = mreq.imr_ifindex;
|
||||
|
|
Loading…
Reference in New Issue
Block a user