Skip to content

Commit

Permalink
compat: ipv6: Pass struct net into nf_ct_frag6_gather.
Browse files Browse the repository at this point in the history
Upstream commit:
    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" <[email protected]>
    Acked-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Upstream: b72775977c39 ("ipv6: Pass struct net into nf_ct_frag6_gather")
Signed-off-by: Joe Stringer <[email protected]>
Acked-by: Jesse Gross <[email protected]>
  • Loading branch information
joestringer committed May 3, 2016
1 parent 39c0ff2 commit 01f35e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion datapath/conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static int handle_fragments(struct net *net, struct sw_flow_key *key,
struct sk_buff *reasm;

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)
return -EINPROGRESS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#if defined(HAVE_NF_CT_FRAG6_CONSUME_ORIG) || \
defined(HAVE_NF_CT_FRAG6_OUTPUT)
#define OVS_NF_DEFRAG6_BACKPORT 1
struct sk_buff *rpl_nf_ct_frag6_gather(struct sk_buff *skb, u32 user);
struct sk_buff *rpl_nf_ct_frag6_gather(struct net *net, struct sk_buff *skb,
u32 user);
int __init rpl_nf_ct_frag6_init(void);
void rpl_nf_ct_frag6_cleanup(void);
void rpl_nf_ct_frag6_consume_orig(struct sk_buff *skb);
Expand Down
5 changes: 2 additions & 3 deletions datapath/linux/compat/nf_conntrack_reasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,11 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
return 0;
}

struct sk_buff *rpl_nf_ct_frag6_gather(struct sk_buff *skb, u32 user)
struct sk_buff *rpl_nf_ct_frag6_gather(struct net *net, struct sk_buff *skb,
u32 user)
{
struct sk_buff *clone;
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_queue *fq;
struct ipv6hdr *hdr;
Expand Down

0 comments on commit 01f35e0

Please sign in to comment.