]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: ipv6: Make udp_tunnel6_xmit_skb() void
authorPetr Machata <petrm@nvidia.com>
Mon, 16 Jun 2025 22:44:13 +0000 (00:44 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Jun 2025 01:18:45 +0000 (18:18 -0700)
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>
include/net/udp_tunnel.h
net/ipv6/ip6_udp_tunnel.c
net/sctp/ipv6.c
net/tipc/udp_media.c

index 28102c8fd8a853244a03ecf95b132000099f2ddc..0b01f6ade20da72f8ea095e55dc2cef989a45bba 100644 (file)
@@ -152,13 +152,13 @@ void udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb
                         __be16 df, __be16 src_port, __be16 dst_port,
                         bool xnet, bool nocheck, u16 ipcb_flags);
 
-int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
-                        struct sk_buff *skb,
-                        struct net_device *dev,
-                        const struct in6_addr *saddr,
-                        const struct in6_addr *daddr,
-                        __u8 prio, __u8 ttl, __be32 label,
-                        __be16 src_port, __be16 dst_port, bool nocheck);
+void udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
+                         struct sk_buff *skb,
+                         struct net_device *dev,
+                         const struct in6_addr *saddr,
+                         const struct in6_addr *daddr,
+                         __u8 prio, __u8 ttl, __be32 label,
+                         __be16 src_port, __be16 dst_port, bool nocheck);
 
 void udp_tunnel_sock_release(struct socket *sock);
 
index c99053189ea8a13be63927290576655e8da0c0fb..21681718b7bb05495e082d35db64edc96a2fff55 100644 (file)
@@ -74,13 +74,13 @@ error:
 }
 EXPORT_SYMBOL_GPL(udp_sock_create6);
 
-int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
-                        struct sk_buff *skb,
-                        struct net_device *dev,
-                        const struct in6_addr *saddr,
-                        const struct in6_addr *daddr,
-                        __u8 prio, __u8 ttl, __be32 label,
-                        __be16 src_port, __be16 dst_port, bool nocheck)
+void udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
+                         struct sk_buff *skb,
+                         struct net_device *dev,
+                         const struct in6_addr *saddr,
+                         const struct in6_addr *daddr,
+                         __u8 prio, __u8 ttl, __be32 label,
+                         __be16 src_port, __be16 dst_port, bool nocheck)
 {
        struct udphdr *uh;
        struct ipv6hdr *ip6h;
@@ -109,7 +109,6 @@ int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
        ip6h->saddr       = *saddr;
 
        ip6tunnel_xmit(sk, skb, dev);
-       return 0;
 }
 EXPORT_SYMBOL_GPL(udp_tunnel6_xmit_skb);
 
index a9ed2ccab1bdb0682dcd029d252d0ac6563818d0..d1ecf7454827bfacfb18ac9c00bc0a7835756dcd 100644 (file)
@@ -261,9 +261,10 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *t)
        skb_set_inner_ipproto(skb, IPPROTO_SCTP);
        label = ip6_make_flowlabel(sock_net(sk), skb, fl6->flowlabel, true, fl6);
 
-       return udp_tunnel6_xmit_skb(dst, sk, skb, NULL, &fl6->saddr,
-                                   &fl6->daddr, tclass, ip6_dst_hoplimit(dst),
-                                   label, sctp_sk(sk)->udp_port, t->encap_port, false);
+       udp_tunnel6_xmit_skb(dst, sk, skb, NULL, &fl6->saddr, &fl6->daddr,
+                            tclass, ip6_dst_hoplimit(dst), label,
+                            sctp_sk(sk)->udp_port, t->encap_port, false);
+       return 0;
 }
 
 /* Returns the dst cache entry for the given source and destination ip
index 87e8c1e6d55042c8b193dc367fd4d8d7cb90fc9b..414713fcd8c5ffeb9c5f57bf164a9421970f73d2 100644 (file)
@@ -172,7 +172,7 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb,
                         struct udp_media_addr *dst, struct dst_cache *cache)
 {
        struct dst_entry *ndst;
-       int ttl, err = 0;
+       int ttl, err;
 
        local_bh_disable();
        ndst = dst_cache_get(cache);
@@ -217,13 +217,13 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb,
                        dst_cache_set_ip6(cache, ndst, &fl6.saddr);
                }
                ttl = ip6_dst_hoplimit(ndst);
-               err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL,
-                                          &src->ipv6, &dst->ipv6, 0, ttl, 0,
-                                          src->port, dst->port, false);
+               udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL,
+                                    &src->ipv6, &dst->ipv6, 0, ttl, 0,
+                                    src->port, dst->port, false);
 #endif
        }
        local_bh_enable();
-       return err;
+       return 0;
 
 tx_error:
        local_bh_enable();