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

ipv6: Move ipv6 stubs to a separate header file

The number of stubs is growing and has nothing to do with addrconf.
Move the definition of the stubs to a separate header file and update
users. In the move, drop the vxlan specific comment before ipv6_stub.

Code move only; no functional change intended.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Ahern and committed by
David S. Miller
3616d08b 5f4d6749

+76 -52
+1 -1
drivers/infiniband/core/addr.c
··· 42 42 #include <net/neighbour.h> 43 43 #include <net/route.h> 44 44 #include <net/netevent.h> 45 - #include <net/addrconf.h> 45 + #include <net/ipv6_stubs.h> 46 46 #include <net/ip6_route.h> 47 47 #include <rdma/ib_addr.h> 48 48 #include <rdma/ib_sa.h>
+1
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
··· 44 44 #include <net/tc_act/tc_pedit.h> 45 45 #include <net/tc_act/tc_csum.h> 46 46 #include <net/arp.h> 47 + #include <net/ipv6_stubs.h> 47 48 #include "en.h" 48 49 #include "en_rep.h" 49 50 #include "en_tc.h"
+1
drivers/net/geneve.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/etherdevice.h> 16 16 #include <linux/hash.h> 17 + #include <net/ipv6_stubs.h> 17 18 #include <net/dst_metadata.h> 18 19 #include <net/gro_cells.h> 19 20 #include <net/rtnetlink.h>
+1
drivers/net/usb/cdc_mbim.c
··· 23 23 #include <linux/usb/cdc_ncm.h> 24 24 #include <net/ipv6.h> 25 25 #include <net/addrconf.h> 26 + #include <net/ipv6_stubs.h> 26 27 27 28 /* alternative VLAN for IP session 0 if not untagged */ 28 29 #define MBIM_IPS0_VID 4094
+1
drivers/net/vxlan.c
··· 20 20 #include <linux/ethtool.h> 21 21 #include <net/arp.h> 22 22 #include <net/ndisc.h> 23 + #include <net/ipv6_stubs.h> 23 24 #include <net/ip.h> 24 25 #include <net/icmp.h> 25 26 #include <net/rtnetlink.h>
-47
include/net/addrconf.h
··· 238 238 239 239 void ipv6_mc_dad_complete(struct inet6_dev *idev); 240 240 241 - /* A stub used by vxlan module. This is ugly, ideally these 242 - * symbols should be built into the core kernel. 243 - */ 244 - struct ipv6_stub { 245 - int (*ipv6_sock_mc_join)(struct sock *sk, int ifindex, 246 - const struct in6_addr *addr); 247 - int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex, 248 - const struct in6_addr *addr); 249 - int (*ipv6_dst_lookup)(struct net *net, struct sock *sk, 250 - struct dst_entry **dst, struct flowi6 *fl6); 251 - int (*ipv6_route_input)(struct sk_buff *skb); 252 - 253 - struct fib6_table *(*fib6_get_table)(struct net *net, u32 id); 254 - struct fib6_info *(*fib6_lookup)(struct net *net, int oif, 255 - struct flowi6 *fl6, int flags); 256 - struct fib6_info *(*fib6_table_lookup)(struct net *net, 257 - struct fib6_table *table, 258 - int oif, struct flowi6 *fl6, 259 - int flags); 260 - struct fib6_info *(*fib6_multipath_select)(const struct net *net, 261 - struct fib6_info *f6i, 262 - struct flowi6 *fl6, int oif, 263 - const struct sk_buff *skb, 264 - int strict); 265 - u32 (*ip6_mtu_from_fib6)(struct fib6_info *f6i, struct in6_addr *daddr, 266 - struct in6_addr *saddr); 267 - 268 - void (*udpv6_encap_enable)(void); 269 - void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr, 270 - const struct in6_addr *solicited_addr, 271 - bool router, bool solicited, bool override, bool inc_opt); 272 - struct neigh_table *nd_tbl; 273 - }; 274 - extern const struct ipv6_stub *ipv6_stub __read_mostly; 275 - 276 - /* A stub used by bpf helpers. Similarly ugly as ipv6_stub */ 277 - struct ipv6_bpf_stub { 278 - int (*inet6_bind)(struct sock *sk, struct sockaddr *uaddr, int addr_len, 279 - bool force_bind_address_no_port, bool with_lock); 280 - struct sock *(*udp6_lib_lookup)(struct net *net, 281 - const struct in6_addr *saddr, __be16 sport, 282 - const struct in6_addr *daddr, __be16 dport, 283 - int dif, int sdif, struct udp_table *tbl, 284 - struct sk_buff *skb); 285 - }; 286 - extern const struct ipv6_bpf_stub *ipv6_bpf_stub __read_mostly; 287 - 288 241 /* 289 242 * identify MLD packets for MLD filter exceptions 290 243 */
+63
include/net/ipv6_stubs.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _IPV6_STUBS_H 3 + #define _IPV6_STUBS_H 4 + 5 + #include <linux/in6.h> 6 + #include <linux/netdevice.h> 7 + #include <linux/skbuff.h> 8 + #include <net/dst.h> 9 + #include <net/flow.h> 10 + #include <net/neighbour.h> 11 + #include <net/sock.h> 12 + 13 + /* structs from net/ip6_fib.h */ 14 + struct fib6_info; 15 + 16 + /* This is ugly, ideally these symbols should be built 17 + * into the core kernel. 18 + */ 19 + struct ipv6_stub { 20 + int (*ipv6_sock_mc_join)(struct sock *sk, int ifindex, 21 + const struct in6_addr *addr); 22 + int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex, 23 + const struct in6_addr *addr); 24 + int (*ipv6_dst_lookup)(struct net *net, struct sock *sk, 25 + struct dst_entry **dst, struct flowi6 *fl6); 26 + int (*ipv6_route_input)(struct sk_buff *skb); 27 + 28 + struct fib6_table *(*fib6_get_table)(struct net *net, u32 id); 29 + struct fib6_info *(*fib6_lookup)(struct net *net, int oif, 30 + struct flowi6 *fl6, int flags); 31 + struct fib6_info *(*fib6_table_lookup)(struct net *net, 32 + struct fib6_table *table, 33 + int oif, struct flowi6 *fl6, 34 + int flags); 35 + struct fib6_info *(*fib6_multipath_select)(const struct net *net, 36 + struct fib6_info *f6i, 37 + struct flowi6 *fl6, int oif, 38 + const struct sk_buff *skb, 39 + int strict); 40 + u32 (*ip6_mtu_from_fib6)(struct fib6_info *f6i, struct in6_addr *daddr, 41 + struct in6_addr *saddr); 42 + 43 + void (*udpv6_encap_enable)(void); 44 + void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr, 45 + const struct in6_addr *solicited_addr, 46 + bool router, bool solicited, bool override, bool inc_opt); 47 + struct neigh_table *nd_tbl; 48 + }; 49 + extern const struct ipv6_stub *ipv6_stub __read_mostly; 50 + 51 + /* A stub used by bpf helpers. Similarly ugly as ipv6_stub */ 52 + struct ipv6_bpf_stub { 53 + int (*inet6_bind)(struct sock *sk, struct sockaddr *uaddr, int addr_len, 54 + bool force_bind_address_no_port, bool with_lock); 55 + struct sock *(*udp6_lib_lookup)(struct net *net, 56 + const struct in6_addr *saddr, __be16 sport, 57 + const struct in6_addr *daddr, __be16 dport, 58 + int dif, int sdif, struct udp_table *tbl, 59 + struct sk_buff *skb); 60 + }; 61 + extern const struct ipv6_bpf_stub *ipv6_bpf_stub __read_mostly; 62 + 63 + #endif
+1 -1
include/net/udp_tunnel.h
··· 7 7 8 8 #if IS_ENABLED(CONFIG_IPV6) 9 9 #include <net/ipv6.h> 10 - #include <net/addrconf.h> 10 + #include <net/ipv6_stubs.h> 11 11 #endif 12 12 13 13 struct udp_port_cfg {
+1
net/bridge/br_arp_nd_proxy.c
··· 21 21 #include <linux/if_vlan.h> 22 22 #include <linux/inetdevice.h> 23 23 #include <net/addrconf.h> 24 + #include <net/ipv6_stubs.h> 24 25 #if IS_ENABLED(CONFIG_IPV6) 25 26 #include <net/ip6_checksum.h> 26 27 #endif
+1
net/core/filter.c
··· 74 74 #include <net/seg6.h> 75 75 #include <net/seg6_local.h> 76 76 #include <net/lwtunnel.h> 77 + #include <net/ipv6_stubs.h> 77 78 78 79 /** 79 80 * sk_filter_trim_cap - run a packet through a socket filter
+1
net/core/lwt_bpf.c
··· 18 18 #include <net/lwtunnel.h> 19 19 #include <net/gre.h> 20 20 #include <net/ip6_route.h> 21 + #include <net/ipv6_stubs.h> 21 22 22 23 struct bpf_lwt_prog { 23 24 struct bpf_prog *prog;
+1 -1
net/ipv6/addrconf_core.c
··· 5 5 6 6 #include <linux/export.h> 7 7 #include <net/ipv6.h> 8 - #include <net/addrconf.h> 8 + #include <net/ipv6_stubs.h> 9 9 #include <net/ip.h> 10 10 11 11 /* if ipv6 module registers this function is used by xfrm to force all
+1
net/ipv6/af_inet6.c
··· 56 56 #include <net/transp_v6.h> 57 57 #include <net/ip6_route.h> 58 58 #include <net/addrconf.h> 59 + #include <net/ipv6_stubs.h> 59 60 #include <net/ndisc.h> 60 61 #ifdef CONFIG_IPV6_TUNNEL 61 62 #include <net/ip6_tunnel.h>
+1 -1
net/mpls/af_mpls.c
··· 22 22 #if IS_ENABLED(CONFIG_IPV6) 23 23 #include <net/ipv6.h> 24 24 #endif 25 - #include <net/addrconf.h> 25 + #include <net/ipv6_stubs.h> 26 26 #include <net/nexthop.h> 27 27 #include "internal.h" 28 28
+1 -1
net/tipc/udp_media.c
··· 44 44 #include <net/sock.h> 45 45 #include <net/ip.h> 46 46 #include <net/udp_tunnel.h> 47 - #include <net/addrconf.h> 47 + #include <net/ipv6_stubs.h> 48 48 #include <linux/tipc_netlink.h> 49 49 #include "core.h" 50 50 #include "addr.h"