OSDN Git Service

netfilter: move nf_bridge_frag_data struct definition to a more appropriate header.
authorJeremy Sowden <jeremy@azazel.net>
Fri, 13 Sep 2019 08:13:09 +0000 (09:13 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 13 Sep 2019 10:35:33 +0000 (12:35 +0200)
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>
include/linux/netfilter_bridge.h
include/linux/netfilter_ipv6.h
include/net/netfilter/nf_conntrack_bridge.h
net/bridge/netfilter/nf_conntrack_bridge.c
net/ipv6/netfilter.c

index 5f2614d..f980edf 100644 (file)
@@ -5,6 +5,13 @@
 #include <uapi/linux/netfilter_bridge.h>
 #include <linux/skbuff.h>
 
+struct nf_bridge_frag_data {
+       char    mac[ETH_HLEN];
+       bool    vlan_present;
+       u16     vlan_tci;
+       __be16  vlan_proto;
+};
+
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 
 int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
index c150020..aac42c2 100644 (file)
@@ -32,7 +32,7 @@ struct ip6_rt_info {
 };
 
 struct nf_queue_entry;
-struct nf_ct_bridge_frag_data;
+struct nf_bridge_frag_data;
 
 /*
  * Hook functions for ipv6 to allow xt_* modules to be built-in even
@@ -61,9 +61,9 @@ struct nf_ipv6_ops {
        int (*br_defrag)(struct net *net, struct sk_buff *skb, u32 user);
        int (*br_fragment)(struct net *net, struct sock *sk,
                           struct sk_buff *skb,
-                          struct nf_ct_bridge_frag_data *data,
+                          struct nf_bridge_frag_data *data,
                           int (*output)(struct net *, struct sock *sk,
-                                        const struct nf_ct_bridge_frag_data *data,
+                                        const struct nf_bridge_frag_data *data,
                                         struct sk_buff *));
 #endif
 };
@@ -135,16 +135,16 @@ static inline int nf_ipv6_br_defrag(struct net *net, struct sk_buff *skb,
 }
 
 int br_ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
-                   struct nf_ct_bridge_frag_data *data,
+                   struct nf_bridge_frag_data *data,
                    int (*output)(struct net *, struct sock *sk,
-                                 const struct nf_ct_bridge_frag_data *data,
+                                 const struct nf_bridge_frag_data *data,
                                  struct sk_buff *));
 
 static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk,
                                     struct sk_buff *skb,
-                                    struct nf_ct_bridge_frag_data *data,
+                                    struct nf_bridge_frag_data *data,
                                     int (*output)(struct net *, struct sock *sk,
-                                                  const struct nf_ct_bridge_frag_data *data,
+                                                  const struct nf_bridge_frag_data *data,
                                                   struct sk_buff *))
 {
 #if IS_MODULE(CONFIG_IPV6)
index 34c28f2..01b62fd 100644 (file)
@@ -16,11 +16,4 @@ struct nf_ct_bridge_info {
 void nf_ct_bridge_register(struct nf_ct_bridge_info *info);
 void nf_ct_bridge_unregister(struct nf_ct_bridge_info *info);
 
-struct nf_ct_bridge_frag_data {
-       char    mac[ETH_HLEN];
-       bool    vlan_present;
-       u16     vlan_tci;
-       __be16  vlan_proto;
-};
-
 #endif
index c9ce321..8842798 100644 (file)
@@ -26,9 +26,9 @@
  */
 static int nf_br_ip_fragment(struct net *net, struct sock *sk,
                             struct sk_buff *skb,
-                            struct nf_ct_bridge_frag_data *data,
+                            struct nf_bridge_frag_data *data,
                             int (*output)(struct net *, struct sock *sk,
-                                          const struct nf_ct_bridge_frag_data *data,
+                                          const struct nf_bridge_frag_data *data,
                                           struct sk_buff *))
 {
        int frag_max_size = BR_INPUT_SKB_CB(skb)->frag_max_size;
@@ -278,7 +278,7 @@ static unsigned int nf_ct_bridge_pre(void *priv, struct sk_buff *skb,
 }
 
 static void nf_ct_bridge_frag_save(struct sk_buff *skb,
-                                  struct nf_ct_bridge_frag_data *data)
+                                  struct nf_bridge_frag_data *data)
 {
        if (skb_vlan_tag_present(skb)) {
                data->vlan_present = true;
@@ -293,10 +293,10 @@ static void nf_ct_bridge_frag_save(struct sk_buff *skb,
 static unsigned int
 nf_ct_bridge_refrag(struct sk_buff *skb, const struct nf_hook_state *state,
                    int (*output)(struct net *, struct sock *sk,
-                                 const struct nf_ct_bridge_frag_data *data,
+                                 const struct nf_bridge_frag_data *data,
                                  struct sk_buff *))
 {
-       struct nf_ct_bridge_frag_data data;
+       struct nf_bridge_frag_data data;
 
        if (!BR_INPUT_SKB_CB(skb)->frag_max_size)
                return NF_ACCEPT;
@@ -319,7 +319,7 @@ nf_ct_bridge_refrag(struct sk_buff *skb, const struct nf_hook_state *state,
 
 /* Actually only slow path refragmentation needs this. */
 static int nf_ct_bridge_frag_restore(struct sk_buff *skb,
-                                    const struct nf_ct_bridge_frag_data *data)
+                                    const struct nf_bridge_frag_data *data)
 {
        int err;
 
@@ -340,7 +340,7 @@ static int nf_ct_bridge_frag_restore(struct sk_buff *skb,
 }
 
 static int nf_ct_bridge_refrag_post(struct net *net, struct sock *sk,
-                                   const struct nf_ct_bridge_frag_data *data,
+                                   const struct nf_bridge_frag_data *data,
                                    struct sk_buff *skb)
 {
        int err;
index 61819ed..a9bff55 100644 (file)
@@ -113,9 +113,9 @@ int __nf_ip6_route(struct net *net, struct dst_entry **dst,
 EXPORT_SYMBOL_GPL(__nf_ip6_route);
 
 int br_ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
-                   struct nf_ct_bridge_frag_data *data,
+                   struct nf_bridge_frag_data *data,
                    int (*output)(struct net *, struct sock *sk,
-                                 const struct nf_ct_bridge_frag_data *data,
+                                 const struct nf_bridge_frag_data *data,
                                  struct sk_buff *))
 {
        int frag_max_size = BR_INPUT_SKB_CB(skb)->frag_max_size;