1
0
Fork 0

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>
pull/193/head
Miaohe Lin 2020-08-25 08:10:37 -04:00 committed by David S. Miller
parent 0ce779a9f5
commit fdf1923bf9
1 changed files with 2 additions and 3 deletions

View File

@ -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;