Skip to content

Commit 6a7d88c

Browse files
pmachatakuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/7facacf9d8ca3ca9391a4aee88160913671b868d.1750113335.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 35bec72 commit 6a7d88c

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

include/net/udp_tunnel.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ void udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb
152152
__be16 df, __be16 src_port, __be16 dst_port,
153153
bool xnet, bool nocheck, u16 ipcb_flags);
154154

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);
162162

163163
void udp_tunnel_sock_release(struct socket *sock);
164164

net/ipv6/ip6_udp_tunnel.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ int udp_sock_create6(struct net *net, struct udp_port_cfg *cfg,
7474
}
7575
EXPORT_SYMBOL_GPL(udp_sock_create6);
7676

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)
8484
{
8585
struct udphdr *uh;
8686
struct ipv6hdr *ip6h;
@@ -109,7 +109,6 @@ int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
109109
ip6h->saddr = *saddr;
110110

111111
ip6tunnel_xmit(sk, skb, dev);
112-
return 0;
113112
}
114113
EXPORT_SYMBOL_GPL(udp_tunnel6_xmit_skb);
115114

net/sctp/ipv6.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,10 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *t)
261261
skb_set_inner_ipproto(skb, IPPROTO_SCTP);
262262
label = ip6_make_flowlabel(sock_net(sk), skb, fl6->flowlabel, true, fl6);
263263

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;
267268
}
268269

269270
/* Returns the dst cache entry for the given source and destination ip

net/tipc/udp_media.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb,
172172
struct udp_media_addr *dst, struct dst_cache *cache)
173173
{
174174
struct dst_entry *ndst;
175-
int ttl, err = 0;
175+
int ttl, err;
176176

177177
local_bh_disable();
178178
ndst = dst_cache_get(cache);
@@ -217,13 +217,13 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb,
217217
dst_cache_set_ip6(cache, ndst, &fl6.saddr);
218218
}
219219
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);
223223
#endif
224224
}
225225
local_bh_enable();
226-
return err;
226+
return 0;
227227

228228
tx_error:
229229
local_bh_enable();

0 commit comments

Comments
 (0)