mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
ipv4: Pass struct net into ip_defrag and ip_check_defrag
The function ip_defrag is called on both the input and the output paths of the networking stack. In particular conntrack when it is tracking outbound packets from the local machine calls ip_defrag. So add a struct net parameter and stop making ip_defrag guess which network namespace it needs to defragment packets in. Signed-off-by: "Eric W. Biederman" <[email protected]> Acked-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
37fcbab61b
commit
19bcf9f203
8 changed files with 20 additions and 19 deletions
|
|
@ -1439,17 +1439,17 @@ static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev,
|
|||
{
|
||||
struct packet_fanout *f = pt->af_packet_priv;
|
||||
unsigned int num = READ_ONCE(f->num_members);
|
||||
struct net *net = read_pnet(&f->net);
|
||||
struct packet_sock *po;
|
||||
unsigned int idx;
|
||||
|
||||
if (!net_eq(dev_net(dev), read_pnet(&f->net)) ||
|
||||
!num) {
|
||||
if (!net_eq(dev_net(dev), net) || !num) {
|
||||
kfree_skb(skb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fanout_has_flag(f, PACKET_FANOUT_FLAG_DEFRAG)) {
|
||||
skb = ip_check_defrag(skb, IP_DEFRAG_AF_PACKET);
|
||||
skb = ip_check_defrag(net, skb, IP_DEFRAG_AF_PACKET);
|
||||
if (!skb)
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue