ipv6: Pass struct net into nf_ct_frag6_gather
The function nf_ct_frag6_gather is called on both the input and the output paths of the networking stack. In particular ipv6_defrag which calls nf_ct_frag6_gather is called from both the the PRE_ROUTING chain on input and the LOCAL_OUT chain on output. The addition of a net parameter makes it explicit which network namespace the packets are being reassembled in, and removes the need for nf_ct_frag6_gather to guess. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
19bcf9f203
commit
b72775977c
@ -5,7 +5,7 @@ void nf_defrag_ipv6_enable(void);
|
|||||||
|
|
||||||
int nf_ct_frag6_init(void);
|
int nf_ct_frag6_init(void);
|
||||||
void nf_ct_frag6_cleanup(void);
|
void nf_ct_frag6_cleanup(void);
|
||||||
struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user);
|
struct sk_buff *nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user);
|
||||||
void nf_ct_frag6_consume_orig(struct sk_buff *skb);
|
void nf_ct_frag6_consume_orig(struct sk_buff *skb);
|
||||||
|
|
||||||
struct inet_frags_ctl;
|
struct inet_frags_ctl;
|
||||||
|
@ -563,12 +563,10 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user)
|
struct sk_buff *nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user)
|
||||||
{
|
{
|
||||||
struct sk_buff *clone;
|
struct sk_buff *clone;
|
||||||
struct net_device *dev = skb->dev;
|
struct net_device *dev = skb->dev;
|
||||||
struct net *net = skb_dst(skb) ? dev_net(skb_dst(skb)->dev)
|
|
||||||
: dev_net(skb->dev);
|
|
||||||
struct frag_hdr *fhdr;
|
struct frag_hdr *fhdr;
|
||||||
struct frag_queue *fq;
|
struct frag_queue *fq;
|
||||||
struct ipv6hdr *hdr;
|
struct ipv6hdr *hdr;
|
||||||
|
@ -63,7 +63,8 @@ static unsigned int ipv6_defrag(void *priv,
|
|||||||
return NF_ACCEPT;
|
return NF_ACCEPT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
reasm = nf_ct_frag6_gather(skb, nf_ct6_defrag_user(state->hook, skb));
|
reasm = nf_ct_frag6_gather(state->net, skb,
|
||||||
|
nf_ct6_defrag_user(state->hook, skb));
|
||||||
/* queued */
|
/* queued */
|
||||||
if (reasm == NULL)
|
if (reasm == NULL)
|
||||||
return NF_STOLEN;
|
return NF_STOLEN;
|
||||||
|
@ -315,7 +315,7 @@ static int handle_fragments(struct net *net, struct sw_flow_key *key,
|
|||||||
struct sk_buff *reasm;
|
struct sk_buff *reasm;
|
||||||
|
|
||||||
memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
|
memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
|
||||||
reasm = nf_ct_frag6_gather(skb, user);
|
reasm = nf_ct_frag6_gather(net, skb, user);
|
||||||
if (!reasm)
|
if (!reasm)
|
||||||
return -EINPROGRESS;
|
return -EINPROGRESS;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user