Use netdev_feature_xxx helpers to replace the logical operation for netdev features.
Signed-off-by: Jian Shen shenjian15@huawei.com --- net/dccp/ipv4.c | 2 +- net/dccp/ipv6.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 0ea29270d7e5..f6161a100dbe 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -138,7 +138,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) */ dccp_set_state(sk, DCCP_CLOSED); ip_rt_put(rt); - sk->sk_route_caps = 0; + netdev_feature_zero(&sk->sk_route_caps); inet->inet_dport = 0; goto out; } diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index fa663518fa0e..0f966e02ddc4 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -489,8 +489,9 @@ static struct sock *dccp_v6_request_recv_sock(const struct sock *sk, */
ip6_dst_store(newsk, dst, NULL, NULL); - newsk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM | - NETIF_F_TSO); + netdev_feature_copy(&newsk->sk_route_caps, dst->dev->features); + netdev_feature_clear_bits(NETIF_F_IP_CSUM | NETIF_F_TSO, + &newsk->sk_route_caps); newdp6 = (struct dccp6_sock *)newsk; newinet = inet_sk(newsk); newinet->pinet6 = &newdp6->inet6; @@ -970,7 +971,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, __sk_dst_reset(sk); failure: inet->inet_dport = 0; - sk->sk_route_caps = 0; + netdev_feature_zero(&sk->sk_route_caps); return err; }