|
|
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
#define PACKET_FANOUT_LB 1
|
|
|
--- a/net/packet/af_packet.c
|
|
|
+++ b/net/packet/af_packet.c
|
|
|
-@@ -1864,6 +1864,7 @@ static int packet_rcv_spkt(struct sk_buf
|
|
|
+@@ -1925,6 +1925,7 @@ static int packet_rcv_spkt(struct sk_buf
|
|
|
{
|
|
|
struct sock *sk;
|
|
|
struct sockaddr_pkt *spkt;
|
|
|
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
|
|
|
/*
|
|
|
* When we registered the protocol we saved the socket in the data
|
|
|
-@@ -1871,6 +1872,7 @@ static int packet_rcv_spkt(struct sk_buf
|
|
|
+@@ -1932,6 +1933,7 @@ static int packet_rcv_spkt(struct sk_buf
|
|
|
*/
|
|
|
|
|
|
sk = pt->af_packet_priv;
|
|
|
@@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
|
|
|
/*
|
|
|
* Yank back the headers [hope the device set this
|
|
|
-@@ -1883,7 +1885,7 @@ static int packet_rcv_spkt(struct sk_buf
|
|
|
+@@ -1944,7 +1946,7 @@ static int packet_rcv_spkt(struct sk_buf
|
|
|
* so that this procedure is noop.
|
|
|
*/
|
|
|
|
|
|
@@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
goto out;
|
|
|
|
|
|
if (!net_eq(dev_net(dev), sock_net(sk)))
|
|
|
-@@ -2129,12 +2131,12 @@ static int packet_rcv(struct sk_buff *sk
|
|
|
+@@ -2190,12 +2192,12 @@ static int packet_rcv(struct sk_buff *sk
|
|
|
unsigned int snaplen, res;
|
|
|
bool is_drop_n_account = false;
|
|
|
|
|
|
@@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
if (!net_eq(dev_net(dev), sock_net(sk)))
|
|
|
goto drop;
|
|
|
|
|
|
-@@ -2261,12 +2263,12 @@ static int tpacket_rcv(struct sk_buff *s
|
|
|
+@@ -2322,12 +2324,12 @@ static int tpacket_rcv(struct sk_buff *s
|
|
|
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
|
|
|
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
|
|
|
|
|
|
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
if (!net_eq(dev_net(dev), sock_net(sk)))
|
|
|
goto drop;
|
|
|
|
|
|
-@@ -3385,6 +3387,7 @@ static int packet_create(struct net *net
|
|
|
+@@ -3451,6 +3453,7 @@ static int packet_create(struct net *net
|
|
|
mutex_init(&po->pg_vec_lock);
|
|
|
po->rollover = NULL;
|
|
|
po->prot_hook.func = packet_rcv;
|
|
|
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
|
|
|
if (sock->type == SOCK_PACKET)
|
|
|
po->prot_hook.func = packet_rcv_spkt;
|
|
|
-@@ -4036,6 +4039,16 @@ packet_setsockopt(struct socket *sock, i
|
|
|
+@@ -4118,6 +4121,16 @@ packet_setsockopt(struct socket *sock, i
|
|
|
packet_sock_flag_set(po, PACKET_SOCK_QDISC_BYPASS, val);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
default:
|
|
|
return -ENOPROTOOPT;
|
|
|
}
|
|
|
-@@ -4095,6 +4108,13 @@ static int packet_getsockopt(struct sock
|
|
|
+@@ -4177,6 +4190,13 @@ static int packet_getsockopt(struct sock
|
|
|
case PACKET_VNET_HDR_SZ:
|
|
|
val = READ_ONCE(po->vnet_hdr_sz);
|
|
|
break;
|