[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210929155334.12454-55-shenjian15@huawei.com>
Date: Wed, 29 Sep 2021 23:51:41 +0800
From: Jian Shen <shenjian15@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <andrew@...n.ch>,
<hkallweit1@...il.com>
CC: <netdev@...r.kernel.org>, <linuxarm@...neuler.org>
Subject: [RFCv2 net-next 054/167] net: dccp: use netdev feature helpers
Use netdev_feature_xxx helpers to replace the logical operation
for netdev features.
Signed-off-by: Jian Shen <shenjian15@...wei.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;
}
--
2.33.0
Powered by blists - more mailing lists