|
@@ -252,6 +252,9 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct
|
|
struct sock *sk;
|
|
struct sock *sk;
|
|
struct sockaddr_pkt *spkt;
|
|
struct sockaddr_pkt *spkt;
|
|
|
|
|
|
|
|
+ if (dev->nd_net != &init_net)
|
|
|
|
+ goto out;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* When we registered the protocol we saved the socket in the data
|
|
* When we registered the protocol we saved the socket in the data
|
|
* field for just this event.
|
|
* field for just this event.
|
|
@@ -452,6 +455,9 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
|
|
int skb_len = skb->len;
|
|
int skb_len = skb->len;
|
|
unsigned int snaplen, res;
|
|
unsigned int snaplen, res;
|
|
|
|
|
|
|
|
+ if (dev->nd_net != &init_net)
|
|
|
|
+ goto drop;
|
|
|
|
+
|
|
if (skb->pkt_type == PACKET_LOOPBACK)
|
|
if (skb->pkt_type == PACKET_LOOPBACK)
|
|
goto drop;
|
|
goto drop;
|
|
|
|
|
|
@@ -568,6 +574,9 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
|
|
struct sk_buff *copy_skb = NULL;
|
|
struct sk_buff *copy_skb = NULL;
|
|
struct timeval tv;
|
|
struct timeval tv;
|
|
|
|
|
|
|
|
+ if (dev->nd_net != &init_net)
|
|
|
|
+ goto drop;
|
|
|
|
+
|
|
if (skb->pkt_type == PACKET_LOOPBACK)
|
|
if (skb->pkt_type == PACKET_LOOPBACK)
|
|
goto drop;
|
|
goto drop;
|
|
|
|
|