OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 85... | Line 85... | |||
85 | + goto drop; |
85 | + goto drop; |
|
86 | + |
86 | + |
|
87 | if (!net_eq(dev_net(dev), sock_net(sk))) |
87 | if (!net_eq(dev_net(dev), sock_net(sk))) |
|
88 | goto drop; |
88 | goto drop; |
|
Line 89... | Line 89... | |||
89 | |
89 | |
|
90 | @@ -3269,6 +3271,7 @@ static int packet_create(struct net *net |
90 | @@ -3260,6 +3262,7 @@ static int packet_create(struct net *net |
|
91 | mutex_init(&po->pg_vec_lock); |
91 | mutex_init(&po->pg_vec_lock); |
|
92 | po->rollover = NULL; |
92 | po->rollover = NULL; |
|
93 | po->prot_hook.func = packet_rcv; |
93 | po->prot_hook.func = packet_rcv; |
|
Line 94... | Line 94... | |||
94 | + po->pkt_type = PACKET_MASK_ANY & ~(1 << PACKET_LOOPBACK); |
94 | + po->pkt_type = PACKET_MASK_ANY & ~(1 << PACKET_LOOPBACK); |
|
95 | |
95 | |
|
96 | if (sock->type == SOCK_PACKET) |
96 | if (sock->type == SOCK_PACKET) |
|
97 | po->prot_hook.func = packet_rcv_spkt; |
97 | po->prot_hook.func = packet_rcv_spkt; |
|
98 | @@ -3882,6 +3885,16 @@ packet_setsockopt(struct socket *sock, i |
98 | @@ -3873,6 +3876,16 @@ packet_setsockopt(struct socket *sock, i |
|
99 | po->xmit = val ? packet_direct_xmit : dev_queue_xmit; |
99 | po->xmit = val ? packet_direct_xmit : dev_queue_xmit; |
|
100 | return 0; |
100 | return 0; |
|
101 | } |
101 | } |
|
Line 110... | Line 110... | |||
110 | + return 0; |
110 | + return 0; |
|
111 | + } |
111 | + } |
|
112 | default: |
112 | default: |
|
113 | return -ENOPROTOOPT; |
113 | return -ENOPROTOOPT; |
|
114 | } |
114 | } |
|
115 | @@ -3934,6 +3947,13 @@ static int packet_getsockopt(struct sock |
115 | @@ -3925,6 +3938,13 @@ static int packet_getsockopt(struct sock |
|
116 | case PACKET_VNET_HDR: |
116 | case PACKET_VNET_HDR: |
|
117 | val = po->has_vnet_hdr; |
117 | val = po->has_vnet_hdr; |
|
118 | break; |
118 | break; |
|
119 | + case PACKET_RECV_TYPE: |
119 | + case PACKET_RECV_TYPE: |
|
120 | + if (len > sizeof(unsigned int)) |
120 | + if (len > sizeof(unsigned int)) |