projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
brcm47xx: add support for kernel 3.6
[openwrt.git]
/
target
/
linux
/
generic
/
patches-3.6
/
630-packet_socket_type.patch
diff --git
a/target/linux/generic/patches-3.6/630-packet_socket_type.patch
b/target/linux/generic/patches-3.6/630-packet_socket_type.patch
index
231b745
..
a630d1d
100644
(file)
--- a/
target/linux/generic/patches-3.6/630-packet_socket_type.patch
+++ b/
target/linux/generic/patches-3.6/630-packet_socket_type.patch
@@
-26,7
+26,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
#define PACKET_FANOUT_LB 1
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
#define PACKET_FANOUT_LB 1
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
-@@ -29
6,6 +296
,7 @@ struct packet_sock {
+@@ -29
5,6 +295
,7 @@ struct packet_sock {
unsigned int tp_loss:1;
unsigned int tp_tstamp;
struct packet_type prot_hook ____cacheline_aligned_in_smp;
unsigned int tp_loss:1;
unsigned int tp_tstamp;
struct packet_type prot_hook ____cacheline_aligned_in_smp;
@@
-34,7
+34,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
};
#define PACKET_FANOUT_MAX 256
};
#define PACKET_FANOUT_MAX 256
-@@ -138
3,6 +1384
,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -138
4,6 +1385
,7 @@ static int packet_rcv_spkt(struct sk_buf
{
struct sock *sk;
struct sockaddr_pkt *spkt;
{
struct sock *sk;
struct sockaddr_pkt *spkt;
@@
-42,7
+42,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
/*
* When we registered the protocol we saved the socket in the data
/*
* When we registered the protocol we saved the socket in the data
-@@ -139
0,6 +1392
,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -139
1,6 +1393
,7 @@ static int packet_rcv_spkt(struct sk_buf
*/
sk = pt->af_packet_priv;
*/
sk = pt->af_packet_priv;
@@
-50,7
+50,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
/*
* Yank back the headers [hope the device set this
/*
* Yank back the headers [hope the device set this
-@@ -140
2,7 +1405
,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -140
3,7 +1406
,7 @@ static int packet_rcv_spkt(struct sk_buf
* so that this procedure is noop.
*/
* so that this procedure is noop.
*/
@@
-59,7
+59,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
-@@ -1
596,12 +1599
,12 @@ static int packet_rcv(struct sk_buff *sk
+@@ -1
609,12 +1612
,12 @@ static int packet_rcv(struct sk_buff *sk
int skb_len = skb->len;
unsigned int snaplen, res;
int skb_len = skb->len;
unsigned int snaplen, res;
@@
-75,7
+75,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -17
20,12 +1723
,12 @@ static int tpacket_rcv(struct sk_buff *s
+@@ -17
33,12 +1736
,12 @@ static int tpacket_rcv(struct sk_buff *s
struct timespec ts;
struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb);
struct timespec ts;
struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb);
@@
-91,7
+91,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -2
595,6 +2598
,7 @@ static int packet_create(struct net *net
+@@ -2
619,6 +2622
,7 @@ static int packet_create(struct net *net
spin_lock_init(&po->bind_lock);
mutex_init(&po->pg_vec_lock);
po->prot_hook.func = packet_rcv;
spin_lock_init(&po->bind_lock);
mutex_init(&po->pg_vec_lock);
po->prot_hook.func = packet_rcv;
@@
-99,7
+99,7
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
-@@ -3
192,6 +3196
,16 @@ packet_setsockopt(struct socket *sock, i
+@@ -3
216,6 +3220
,16 @@ packet_setsockopt(struct socket *sock, i
return fanout_add(sk, val & 0xffff, val >> 16);
}
return fanout_add(sk, val & 0xffff, val >> 16);
}
@@
-116,9
+116,9
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
default:
return -ENOPROTOOPT;
}
default:
return -ENOPROTOOPT;
}
-@@ -32
62,6 +3276
,13 @@ static int packet_getsockopt(struct sock
-
-
data = &val
;
+@@ -32
70,6 +3284
,13 @@ static int packet_getsockopt(struct sock
+ case PACKET_VNET_HDR:
+
val = po->has_vnet_hdr
;
break;
+ case PACKET_RECV_TYPE:
+ if (len > sizeof(unsigned int))
break;
+ case PACKET_RECV_TYPE:
+ if (len > sizeof(unsigned int))
@@
-128,5
+128,5
@@
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+ data = &val;
+ break;
case PACKET_VERSION:
+ data = &val;
+ break;
case PACKET_VERSION:
- if (len > sizeof(int))
-
len = sizeof(int)
;
+ val = po->tp_version;
+
break
;