]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netconsole: move push_ipv6() from netpoll
authorBreno Leitao <leitao@debian.org>
Tue, 12 May 2026 10:46:36 +0000 (03:46 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 May 2026 01:09:12 +0000 (18:09 -0700)
push_ipv6() builds the IPv6 header for netconsole's UDP packets.
Its only caller, netpoll_send_udp(), now lives in netconsole, so
the helper can move there as a file-static function. Drop its
EXPORT_SYMBOL_GPL and remove the prototype from
include/linux/netpoll.h.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260512-netconsole_split-v2-3-1191d14ad66d@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c
include/linux/netpoll.h
net/core/netpoll.c

index 56f310041ebdafa0a85493cfcc45d4a7b654f9b0..f805ae95ce7b198e572904bd103658e104cbb933 100644 (file)
@@ -1651,6 +1651,29 @@ static struct notifier_block netconsole_netdev_notifier = {
        .notifier_call  = netconsole_netdev_event,
 };
 
+static void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len)
+{
+       struct ipv6hdr *ip6h;
+
+       skb_push(skb, sizeof(struct ipv6hdr));
+       skb_reset_network_header(skb);
+       ip6h = ipv6_hdr(skb);
+
+       /* ip6h->version = 6; ip6h->priority = 0; */
+       *(unsigned char *)ip6h = 0x60;
+       ip6h->flow_lbl[0] = 0;
+       ip6h->flow_lbl[1] = 0;
+       ip6h->flow_lbl[2] = 0;
+
+       ip6h->payload_len = htons(sizeof(struct udphdr) + len);
+       ip6h->nexthdr = IPPROTO_UDP;
+       ip6h->hop_limit = 32;
+       ip6h->saddr = np->local_ip.in6;
+       ip6h->daddr = np->remote_ip.in6;
+
+       skb->protocol = htons(ETH_P_IPV6);
+}
+
 static int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
 {
        int total_len, ip_len, udp_len;
index 57be72bb82dc9dbd484b33d2f8d34427f5bbb692..7f57bd0eac66d52463ae0a03917d4985ce18f584 100644 (file)
@@ -75,7 +75,6 @@ void do_netpoll_cleanup(struct netpoll *np);
 netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
 struct sk_buff *find_skb(struct netpoll *np, int len, int reserve);
 void netpoll_udp_checksum(struct netpoll *np, struct sk_buff *skb, int len);
-void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len);
 void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len);
 void push_udp(struct netpoll *np, struct sk_buff *skb, int len);
 void push_eth(struct netpoll *np, struct sk_buff *skb);
index 39209308efad042f2caf1a95745fc658f33311c1..6a10ca5eaa093b85fd9f625c4edbd2521062b510 100644 (file)
@@ -413,30 +413,6 @@ netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
 }
 EXPORT_SYMBOL(netpoll_send_skb);
 
-void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len)
-{
-       struct ipv6hdr *ip6h;
-
-       skb_push(skb, sizeof(struct ipv6hdr));
-       skb_reset_network_header(skb);
-       ip6h = ipv6_hdr(skb);
-
-       /* ip6h->version = 6; ip6h->priority = 0; */
-       *(unsigned char *)ip6h = 0x60;
-       ip6h->flow_lbl[0] = 0;
-       ip6h->flow_lbl[1] = 0;
-       ip6h->flow_lbl[2] = 0;
-
-       ip6h->payload_len = htons(sizeof(struct udphdr) + len);
-       ip6h->nexthdr = IPPROTO_UDP;
-       ip6h->hop_limit = 32;
-       ip6h->saddr = np->local_ip.in6;
-       ip6h->daddr = np->remote_ip.in6;
-
-       skb->protocol = htons(ETH_P_IPV6);
-}
-EXPORT_SYMBOL_GPL(push_ipv6);
-
 void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len)
 {
        static atomic_t ip_ident;