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

netfilter: move nf_bridge_frag_data struct definition to a more appropriate header.

There is a struct definition function in nf_conntrack_bridge.h which is
not specific to conntrack and is used elswhere in netfilter. Move it
into netfilter_bridge.h.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Jeremy Sowden and committed by
Pablo Neira Ayuso
46705b07 e2f1cbb1

+23 -23
+7
include/linux/netfilter_bridge.h
··· 5 5 #include <uapi/linux/netfilter_bridge.h> 6 6 #include <linux/skbuff.h> 7 7 8 + struct nf_bridge_frag_data { 9 + char mac[ETH_HLEN]; 10 + bool vlan_present; 11 + u16 vlan_tci; 12 + __be16 vlan_proto; 13 + }; 14 + 8 15 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) 9 16 10 17 int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
+7 -7
include/linux/netfilter_ipv6.h
··· 32 32 }; 33 33 34 34 struct nf_queue_entry; 35 - struct nf_ct_bridge_frag_data; 35 + struct nf_bridge_frag_data; 36 36 37 37 /* 38 38 * Hook functions for ipv6 to allow xt_* modules to be built-in even ··· 61 61 int (*br_defrag)(struct net *net, struct sk_buff *skb, u32 user); 62 62 int (*br_fragment)(struct net *net, struct sock *sk, 63 63 struct sk_buff *skb, 64 - struct nf_ct_bridge_frag_data *data, 64 + struct nf_bridge_frag_data *data, 65 65 int (*output)(struct net *, struct sock *sk, 66 - const struct nf_ct_bridge_frag_data *data, 66 + const struct nf_bridge_frag_data *data, 67 67 struct sk_buff *)); 68 68 #endif 69 69 }; ··· 135 135 } 136 136 137 137 int br_ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, 138 - struct nf_ct_bridge_frag_data *data, 138 + struct nf_bridge_frag_data *data, 139 139 int (*output)(struct net *, struct sock *sk, 140 - const struct nf_ct_bridge_frag_data *data, 140 + const struct nf_bridge_frag_data *data, 141 141 struct sk_buff *)); 142 142 143 143 static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk, 144 144 struct sk_buff *skb, 145 - struct nf_ct_bridge_frag_data *data, 145 + struct nf_bridge_frag_data *data, 146 146 int (*output)(struct net *, struct sock *sk, 147 - const struct nf_ct_bridge_frag_data *data, 147 + const struct nf_bridge_frag_data *data, 148 148 struct sk_buff *)) 149 149 { 150 150 #if IS_MODULE(CONFIG_IPV6)
-7
include/net/netfilter/nf_conntrack_bridge.h
··· 16 16 void nf_ct_bridge_register(struct nf_ct_bridge_info *info); 17 17 void nf_ct_bridge_unregister(struct nf_ct_bridge_info *info); 18 18 19 - struct nf_ct_bridge_frag_data { 20 - char mac[ETH_HLEN]; 21 - bool vlan_present; 22 - u16 vlan_tci; 23 - __be16 vlan_proto; 24 - }; 25 - 26 19 #endif
+7 -7
net/bridge/netfilter/nf_conntrack_bridge.c
··· 26 26 */ 27 27 static int nf_br_ip_fragment(struct net *net, struct sock *sk, 28 28 struct sk_buff *skb, 29 - struct nf_ct_bridge_frag_data *data, 29 + struct nf_bridge_frag_data *data, 30 30 int (*output)(struct net *, struct sock *sk, 31 - const struct nf_ct_bridge_frag_data *data, 31 + const struct nf_bridge_frag_data *data, 32 32 struct sk_buff *)) 33 33 { 34 34 int frag_max_size = BR_INPUT_SKB_CB(skb)->frag_max_size; ··· 278 278 } 279 279 280 280 static void nf_ct_bridge_frag_save(struct sk_buff *skb, 281 - struct nf_ct_bridge_frag_data *data) 281 + struct nf_bridge_frag_data *data) 282 282 { 283 283 if (skb_vlan_tag_present(skb)) { 284 284 data->vlan_present = true; ··· 293 293 static unsigned int 294 294 nf_ct_bridge_refrag(struct sk_buff *skb, const struct nf_hook_state *state, 295 295 int (*output)(struct net *, struct sock *sk, 296 - const struct nf_ct_bridge_frag_data *data, 296 + const struct nf_bridge_frag_data *data, 297 297 struct sk_buff *)) 298 298 { 299 - struct nf_ct_bridge_frag_data data; 299 + struct nf_bridge_frag_data data; 300 300 301 301 if (!BR_INPUT_SKB_CB(skb)->frag_max_size) 302 302 return NF_ACCEPT; ··· 319 319 320 320 /* Actually only slow path refragmentation needs this. */ 321 321 static int nf_ct_bridge_frag_restore(struct sk_buff *skb, 322 - const struct nf_ct_bridge_frag_data *data) 322 + const struct nf_bridge_frag_data *data) 323 323 { 324 324 int err; 325 325 ··· 340 340 } 341 341 342 342 static int nf_ct_bridge_refrag_post(struct net *net, struct sock *sk, 343 - const struct nf_ct_bridge_frag_data *data, 343 + const struct nf_bridge_frag_data *data, 344 344 struct sk_buff *skb) 345 345 { 346 346 int err;
+2 -2
net/ipv6/netfilter.c
··· 113 113 EXPORT_SYMBOL_GPL(__nf_ip6_route); 114 114 115 115 int br_ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, 116 - struct nf_ct_bridge_frag_data *data, 116 + struct nf_bridge_frag_data *data, 117 117 int (*output)(struct net *, struct sock *sk, 118 - const struct nf_ct_bridge_frag_data *data, 118 + const struct nf_bridge_frag_data *data, 119 119 struct sk_buff *)) 120 120 { 121 121 int frag_max_size = BR_INPUT_SKB_CB(skb)->frag_max_size;