Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: ipv6: Make udp_tunnel6_xmit_skb() void

The function always returns zero, thus the return value does not carry any
signal. Just make it void.

Most callers already ignore the return value. However:

- Refold arguments of the call from sctp_v6_xmit() so that they fit into
the 80-column limit.

- tipc_udp_xmit() initializes err from the return value, but that should
already be always zero at that point. So there's no practical change, but
elision of the assignment prompts a couple more tweaks to clean up the
function.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/7facacf9d8ca3ca9391a4aee88160913671b868d.1750113335.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Petr Machata and committed by
Jakub Kicinski
6a7d88ca 35bec72a

+23 -23
+7 -7
include/net/udp_tunnel.h
··· 152 152 __be16 df, __be16 src_port, __be16 dst_port, 153 153 bool xnet, bool nocheck, u16 ipcb_flags); 154 154 155 - int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk, 156 - struct sk_buff *skb, 157 - struct net_device *dev, 158 - const struct in6_addr *saddr, 159 - const struct in6_addr *daddr, 160 - __u8 prio, __u8 ttl, __be32 label, 161 - __be16 src_port, __be16 dst_port, bool nocheck); 155 + void udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk, 156 + struct sk_buff *skb, 157 + struct net_device *dev, 158 + const struct in6_addr *saddr, 159 + const struct in6_addr *daddr, 160 + __u8 prio, __u8 ttl, __be32 label, 161 + __be16 src_port, __be16 dst_port, bool nocheck); 162 162 163 163 void udp_tunnel_sock_release(struct socket *sock); 164 164
+7 -8
net/ipv6/ip6_udp_tunnel.c
··· 74 74 } 75 75 EXPORT_SYMBOL_GPL(udp_sock_create6); 76 76 77 - int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk, 78 - struct sk_buff *skb, 79 - struct net_device *dev, 80 - const struct in6_addr *saddr, 81 - const struct in6_addr *daddr, 82 - __u8 prio, __u8 ttl, __be32 label, 83 - __be16 src_port, __be16 dst_port, bool nocheck) 77 + void udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk, 78 + struct sk_buff *skb, 79 + struct net_device *dev, 80 + const struct in6_addr *saddr, 81 + const struct in6_addr *daddr, 82 + __u8 prio, __u8 ttl, __be32 label, 83 + __be16 src_port, __be16 dst_port, bool nocheck) 84 84 { 85 85 struct udphdr *uh; 86 86 struct ipv6hdr *ip6h; ··· 109 109 ip6h->saddr = *saddr; 110 110 111 111 ip6tunnel_xmit(sk, skb, dev); 112 - return 0; 113 112 } 114 113 EXPORT_SYMBOL_GPL(udp_tunnel6_xmit_skb); 115 114
+4 -3
net/sctp/ipv6.c
··· 261 261 skb_set_inner_ipproto(skb, IPPROTO_SCTP); 262 262 label = ip6_make_flowlabel(sock_net(sk), skb, fl6->flowlabel, true, fl6); 263 263 264 - return udp_tunnel6_xmit_skb(dst, sk, skb, NULL, &fl6->saddr, 265 - &fl6->daddr, tclass, ip6_dst_hoplimit(dst), 266 - label, sctp_sk(sk)->udp_port, t->encap_port, false); 264 + udp_tunnel6_xmit_skb(dst, sk, skb, NULL, &fl6->saddr, &fl6->daddr, 265 + tclass, ip6_dst_hoplimit(dst), label, 266 + sctp_sk(sk)->udp_port, t->encap_port, false); 267 + return 0; 267 268 } 268 269 269 270 /* Returns the dst cache entry for the given source and destination ip
+5 -5
net/tipc/udp_media.c
··· 172 172 struct udp_media_addr *dst, struct dst_cache *cache) 173 173 { 174 174 struct dst_entry *ndst; 175 - int ttl, err = 0; 175 + int ttl, err; 176 176 177 177 local_bh_disable(); 178 178 ndst = dst_cache_get(cache); ··· 217 217 dst_cache_set_ip6(cache, ndst, &fl6.saddr); 218 218 } 219 219 ttl = ip6_dst_hoplimit(ndst); 220 - err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL, 221 - &src->ipv6, &dst->ipv6, 0, ttl, 0, 222 - src->port, dst->port, false); 220 + udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL, 221 + &src->ipv6, &dst->ipv6, 0, ttl, 0, 222 + src->port, dst->port, false); 223 223 #endif 224 224 } 225 225 local_bh_enable(); 226 - return err; 226 + return 0; 227 227 228 228 tx_error: 229 229 local_bh_enable();