1 diff -Nurp linux-2.6.22-510/include/linux/netfilter/xt_MARK.h linux-2.6.22-520/include/linux/netfilter/xt_MARK.h
2 --- linux-2.6.22-510/include/linux/netfilter/xt_MARK.h 2006-06-17 21:49:35.000000000 -0400
3 +++ linux-2.6.22-520/include/linux/netfilter/xt_MARK.h 2007-12-03 15:11:08.000000000 -0500
4 @@ -11,6 +11,7 @@ enum {
11 struct xt_mark_target_info_v1 {
12 diff -Nurp linux-2.6.22-510/include/linux/netfilter/xt_SETXID.h linux-2.6.22-520/include/linux/netfilter/xt_SETXID.h
13 --- linux-2.6.22-510/include/linux/netfilter/xt_SETXID.h 1969-12-31 19:00:00.000000000 -0500
14 +++ linux-2.6.22-520/include/linux/netfilter/xt_SETXID.h 2007-12-03 15:11:08.000000000 -0500
16 +#ifndef _XT_SETXID_H_target
17 +#define _XT_SETXID_H_target
24 +struct xt_setxid_target_info_v1 {
29 +#endif /*_XT_SETXID_H_target*/
30 diff -Nurp linux-2.6.22-510/include/linux/netfilter_ipv4/ipt_MARK.h linux-2.6.22-520/include/linux/netfilter_ipv4/ipt_MARK.h
31 --- linux-2.6.22-510/include/linux/netfilter_ipv4/ipt_MARK.h 2006-06-17 21:49:35.000000000 -0400
32 +++ linux-2.6.22-520/include/linux/netfilter_ipv4/ipt_MARK.h 2007-12-03 15:11:08.000000000 -0500
34 #define ipt_mark_target_info xt_mark_target_info
37 -#define IPT_MARK_SET XT_MARK_SET
38 -#define IPT_MARK_AND XT_MARK_AND
39 -#define IPT_MARK_OR XT_MARK_OR
40 +#define IPT_MARK_SET XT_MARK_SET
41 +#define IPT_MARK_AND XT_MARK_AND
42 +#define IPT_MARK_OR XT_MARK_OR
43 +#define IPT_MARK_COPYXID XT_MARK_COPYXID
45 #define ipt_mark_target_info_v1 xt_mark_target_info_v1
47 diff -Nurp linux-2.6.22-510/include/linux/netfilter_ipv4/ipt_SETXID.h linux-2.6.22-520/include/linux/netfilter_ipv4/ipt_SETXID.h
48 --- linux-2.6.22-510/include/linux/netfilter_ipv4/ipt_SETXID.h 1969-12-31 19:00:00.000000000 -0500
49 +++ linux-2.6.22-520/include/linux/netfilter_ipv4/ipt_SETXID.h 2007-12-03 15:11:08.000000000 -0500
51 +#ifndef _IPT_SETXID_H_target
52 +#define _IPT_SETXID_H_target
54 +/* Backwards compatibility for old userspace */
56 +#include <linux/netfilter/xt_SETXID.h>
59 +#define IPT_SET_PACKET_XID XT_SET_PACKET_XID
61 +#define ipt_setxid_target_info_v1 xt_setxid_target_info_v1
63 +#endif /*_IPT_SETXID_H_target*/
64 diff -Nurp linux-2.6.22-510/include/linux/skbuff.h linux-2.6.22-520/include/linux/skbuff.h
65 --- linux-2.6.22-510/include/linux/skbuff.h 2007-07-21 18:00:24.000000000 -0400
66 +++ linux-2.6.22-520/include/linux/skbuff.h 2007-12-03 15:20:15.000000000 -0500
67 @@ -302,6 +302,7 @@ struct sk_buff {
73 sk_buff_data_t transport_header;
74 sk_buff_data_t network_header;
75 diff -Nurp linux-2.6.22-510/include/linux/socket.h linux-2.6.22-520/include/linux/socket.h
76 --- linux-2.6.22-510/include/linux/socket.h 2007-07-21 18:00:24.000000000 -0400
77 +++ linux-2.6.22-520/include/linux/socket.h 2007-12-03 15:11:08.000000000 -0500
78 @@ -288,6 +288,8 @@ struct ucred {
82 +#define SO_SETXID SO_PEERCRED
87 diff -Nurp linux-2.6.22-510/include/linux/vserver/network.h linux-2.6.22-520/include/linux/vserver/network.h
88 --- linux-2.6.22-510/include/linux/vserver/network.h 2007-12-03 15:10:48.000000000 -0500
89 +++ linux-2.6.22-520/include/linux/vserver/network.h 2007-12-03 15:11:08.000000000 -0500
90 @@ -44,6 +44,8 @@ static inline uint64_t __nxf_init_set(vo
93 #define NXC_RAW_ICMP 0x00000100
94 +#define NXC_RAW_SOCKET 0x00000200
95 +#define NXC_RAW_SEND 0x00000400
99 diff -Nurp linux-2.6.22-510/include/net/netfilter/nf_conntrack.h linux-2.6.22-520/include/net/netfilter/nf_conntrack.h
100 --- linux-2.6.22-510/include/net/netfilter/nf_conntrack.h 2007-07-21 18:00:24.000000000 -0400
101 +++ linux-2.6.22-520/include/net/netfilter/nf_conntrack.h 2007-12-03 15:11:08.000000000 -0500
102 @@ -131,6 +131,9 @@ struct nf_conn
103 /* Storage reserved for other modules: */
104 union nf_conntrack_proto proto;
106 + /* PLANETLAB. VNET-specific */
107 + xid_t xid[IP_CT_DIR_MAX];
109 /* features dynamically at the end: helper, nat (both optional) */
112 diff -Nurp linux-2.6.22-510/include/net/raw.h linux-2.6.22-520/include/net/raw.h
113 --- linux-2.6.22-510/include/net/raw.h 2007-05-04 09:55:46.000000000 -0400
114 +++ linux-2.6.22-520/include/net/raw.h 2007-12-03 15:11:08.000000000 -0500
115 @@ -36,7 +36,7 @@ extern rwlock_t raw_v4_lock;
117 extern struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num,
118 __be32 raddr, __be32 laddr,
122 extern int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash);
124 diff -Nurp linux-2.6.22-510/net/core/skbuff.c linux-2.6.22-520/net/core/skbuff.c
125 --- linux-2.6.22-510/net/core/skbuff.c 2007-07-21 18:00:25.000000000 -0400
126 +++ linux-2.6.22-520/net/core/skbuff.c 2007-12-03 15:11:08.000000000 -0500
128 #include <linux/rtnetlink.h>
129 #include <linux/init.h>
130 #include <linux/scatterlist.h>
131 +#include <linux/vs_network.h>
133 #include <net/protocol.h>
135 @@ -174,6 +175,7 @@ struct sk_buff *__alloc_skb(unsigned int
137 skb_reset_tail_pointer(skb);
138 skb->end = skb->tail + size;
139 + skb->skb_tag = nx_current_nid();
140 /* make sure we initialize shinfo sequentially */
141 shinfo = skb_shinfo(skb);
142 atomic_set(&shinfo->dataref, 1);
143 @@ -443,6 +445,8 @@ struct sk_buff *skb_clone(struct sk_buff
147 + /* Sapan: Cloned skbs aren't owned by anyone. Let the cloner decide who it belongs to. */
149 atomic_inc(&(skb_shinfo(skb)->dataref));
152 @@ -492,6 +496,7 @@ static void copy_skb_header(struct sk_bu
153 new->tc_index = old->tc_index;
155 skb_copy_secmark(new, old);
156 + new->skb_tag = old->skb_tag;
157 atomic_set(&new->users, 1);
158 skb_shinfo(new)->gso_size = skb_shinfo(old)->gso_size;
159 skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
160 diff -Nurp linux-2.6.22-510/net/core/sock.c linux-2.6.22-520/net/core/sock.c
161 --- linux-2.6.22-510/net/core/sock.c 2007-12-03 15:10:56.000000000 -0500
162 +++ linux-2.6.22-520/net/core/sock.c 2007-12-03 15:11:08.000000000 -0500
163 @@ -444,6 +444,19 @@ set_sndbuf:
168 + if (current_vx_info()) {
172 + if (val < 0 || val > MAX_S_CONTEXT) {
181 /* Don't error on this BSD doesn't and if you think
182 about it this is right. Otherwise apps have to
183 @@ -573,7 +586,7 @@ set_rcvbuf:
184 char devname[IFNAMSIZ];
187 - if (!capable(CAP_NET_RAW)) {
188 + if (!nx_capable(CAP_NET_RAW, NXC_RAW_SOCKET)) {
192 diff -Nurp linux-2.6.22-510/net/ipv4/af_inet.c linux-2.6.22-520/net/ipv4/af_inet.c
193 --- linux-2.6.22-510/net/ipv4/af_inet.c 2007-12-03 15:10:56.000000000 -0500
194 +++ linux-2.6.22-520/net/ipv4/af_inet.c 2007-12-03 15:11:08.000000000 -0500
195 @@ -178,6 +178,8 @@ static int inet_autobind(struct sock *sk
198 inet->sport = htons(inet->num);
199 + sk->sk_xid = vx_current_xid();
200 + sk->sk_nid = nx_current_nid();
204 diff -Nurp linux-2.6.22-510/net/ipv4/icmp.c linux-2.6.22-520/net/ipv4/icmp.c
205 --- linux-2.6.22-510/net/ipv4/icmp.c 2007-12-03 15:11:06.000000000 -0500
206 +++ linux-2.6.22-520/net/ipv4/icmp.c 2007-12-03 15:11:08.000000000 -0500
207 @@ -709,7 +709,7 @@ static void icmp_unreach(struct sk_buff
208 if ((raw_sk = sk_head(&raw_v4_htable[hash])) != NULL) {
209 while ((raw_sk = __raw_v4_lookup(raw_sk, protocol, iph->daddr,
211 - skb->dev->ifindex)) != NULL) {
212 + skb->dev->ifindex, skb->skb_tag)) != NULL) {
213 raw_err(raw_sk, skb, info);
214 raw_sk = sk_next(raw_sk);
215 iph = (struct iphdr *)skb->data;
216 diff -Nurp linux-2.6.22-510/net/ipv4/ip_options.c linux-2.6.22-520/net/ipv4/ip_options.c
217 --- linux-2.6.22-510/net/ipv4/ip_options.c 2007-07-21 18:00:25.000000000 -0400
218 +++ linux-2.6.22-520/net/ipv4/ip_options.c 2007-12-03 15:11:08.000000000 -0500
219 @@ -409,7 +409,7 @@ int ip_options_compile(struct ip_options
223 - if (!skb && !capable(CAP_NET_RAW)) {
224 + if (!skb && !nx_capable(CAP_NET_RAW, NXC_RAW_SOCKET)) {
228 @@ -445,7 +445,7 @@ int ip_options_compile(struct ip_options
229 opt->router_alert = optptr - iph;
232 - if ((!skb && !capable(CAP_NET_RAW)) || opt->cipso) {
233 + if ((!skb && !nx_capable(CAP_NET_RAW, NXC_RAW_SOCKET)) || opt->cipso) {
237 @@ -458,7 +458,7 @@ int ip_options_compile(struct ip_options
241 - if (!skb && !capable(CAP_NET_RAW)) {
242 + if (!skb && !nx_capable(CAP_NET_RAW, NXC_RAW_SOCKET)) {
246 diff -Nurp linux-2.6.22-510/net/ipv4/netfilter/ipt_LOG.c linux-2.6.22-520/net/ipv4/netfilter/ipt_LOG.c
247 --- linux-2.6.22-510/net/ipv4/netfilter/ipt_LOG.c 2007-12-03 15:10:26.000000000 -0500
248 +++ linux-2.6.22-520/net/ipv4/netfilter/ipt_LOG.c 2007-12-03 15:11:08.000000000 -0500
249 @@ -49,6 +49,8 @@ static void dump_packet(const struct nf_
251 logflags = NF_LOG_MASK;
253 + printk("TAG=%d ", skb->skb_tag);
255 ih = skb_header_pointer(skb, iphoff, sizeof(_iph), &_iph);
258 diff -Nurp linux-2.6.22-510/net/ipv4/raw.c linux-2.6.22-520/net/ipv4/raw.c
259 --- linux-2.6.22-510/net/ipv4/raw.c 2007-12-03 15:10:56.000000000 -0500
260 +++ linux-2.6.22-520/net/ipv4/raw.c 2007-12-03 15:11:08.000000000 -0500
261 @@ -103,7 +103,7 @@ static void raw_v4_unhash(struct sock *s
263 struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num,
264 __be32 raddr, __be32 laddr,
268 struct hlist_node *node;
270 @@ -112,6 +112,7 @@ struct sock *__raw_v4_lookup(struct sock
272 if (inet->num == num &&
273 !(inet->daddr && inet->daddr != raddr) &&
274 + (!sk->sk_nx_info || tag == 1 || sk->sk_nid == tag) &&
275 v4_sock_addr_match(sk->sk_nx_info, inet, laddr) &&
276 !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))
277 goto found; /* gotcha */
278 @@ -161,7 +162,7 @@ int raw_v4_input(struct sk_buff *skb, st
280 sk = __raw_v4_lookup(__sk_head(head), iph->protocol,
281 iph->saddr, iph->daddr,
282 - skb->dev->ifindex);
283 + skb->dev->ifindex, skb->skb_tag);
287 @@ -174,7 +175,7 @@ int raw_v4_input(struct sk_buff *skb, st
289 sk = __raw_v4_lookup(sk_next(sk), iph->protocol,
290 iph->saddr, iph->daddr,
291 - skb->dev->ifindex);
292 + skb->dev->ifindex, skb->skb_tag);
295 read_unlock(&raw_v4_lock);
296 @@ -315,7 +316,7 @@ static int raw_send_hdrinc(struct sock *
300 - if (!nx_check(0, VS_ADMIN) && !capable(CAP_NET_RAW) &&
301 + if (!nx_check(0, VS_ADMIN) && !nx_capable(CAP_NET_RAW, NXC_RAW_SOCKET) &&
303 !v4_addr_in_nx_info(sk->sk_nx_info, iph->saddr, NXA_MASK_BIND))
305 diff -Nurp linux-2.6.22-510/net/netfilter/Kconfig linux-2.6.22-520/net/netfilter/Kconfig
306 --- linux-2.6.22-510/net/netfilter/Kconfig 2007-07-21 18:00:27.000000000 -0400
307 +++ linux-2.6.22-520/net/netfilter/Kconfig 2007-12-03 15:11:08.000000000 -0500
308 @@ -389,6 +389,13 @@ config NETFILTER_XT_TARGET_TCPMSS
310 To compile it as a module, choose M here. If unsure, say N.
312 +config NETFILTER_XT_TARGET_SETXID
313 + tristate '"SETXID" target support'
314 + depends on NETFILTER_XTABLES
316 + This option adds a `SETXID' target, which allows you to alter the
319 config NETFILTER_XT_MATCH_COMMENT
320 tristate '"comment" match support'
321 depends on NETFILTER_XTABLES
322 diff -Nurp linux-2.6.22-510/net/netfilter/Makefile linux-2.6.22-520/net/netfilter/Makefile
323 --- linux-2.6.22-510/net/netfilter/Makefile 2007-07-21 17:58:59.000000000 -0400
324 +++ linux-2.6.22-520/net/netfilter/Makefile 2007-12-03 15:11:08.000000000 -0500
325 @@ -37,6 +37,7 @@ obj-$(CONFIG_NF_CONNTRACK_TFTP) += nf_co
326 obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
329 +obj-$(CONFIG_NETFILTER_XT_TARGET_SETXID) += xt_SETXID.o
330 obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o
331 obj-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += xt_CONNMARK.o
332 obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
333 diff -Nurp linux-2.6.22-510/net/netfilter/nf_conntrack_core.c linux-2.6.22-520/net/netfilter/nf_conntrack_core.c
334 --- linux-2.6.22-510/net/netfilter/nf_conntrack_core.c 2007-07-21 18:00:27.000000000 -0400
335 +++ linux-2.6.22-520/net/netfilter/nf_conntrack_core.c 2007-12-03 15:11:08.000000000 -0500
336 @@ -726,6 +726,8 @@ init_conntrack(const struct nf_conntrack
338 /* Overload tuple linked list to put us in unconfirmed list. */
339 list_add(&conntrack->tuplehash[IP_CT_DIR_ORIGINAL].list, &unconfirmed);
340 + conntrack->xid[IP_CT_DIR_ORIGINAL] = -1;
341 + conntrack->xid[IP_CT_DIR_REPLY] = -1;
343 write_unlock_bh(&nf_conntrack_lock);
345 diff -Nurp linux-2.6.22-510/net/netfilter/xt_MARK.c linux-2.6.22-520/net/netfilter/xt_MARK.c
346 --- linux-2.6.22-510/net/netfilter/xt_MARK.c 2007-07-21 17:59:00.000000000 -0400
347 +++ linux-2.6.22-520/net/netfilter/xt_MARK.c 2007-12-03 15:11:08.000000000 -0500
349 * This program is free software; you can redistribute it and/or modify
350 * it under the terms of the GNU General Public License version 2 as
351 * published by the Free Software Foundation.
355 #include <linux/module.h>
356 +#include <linux/version.h>
357 #include <linux/skbuff.h>
358 #include <linux/ip.h>
359 #include <net/checksum.h>
360 +#include <net/route.h>
361 +#include <net/inet_hashtables.h>
363 +#include <net/netfilter/nf_conntrack.h>
364 #include <linux/netfilter/x_tables.h>
365 #include <linux/netfilter/xt_MARK.h>
367 @@ -21,6 +26,48 @@ MODULE_DESCRIPTION("ip[6]tables MARK mod
368 MODULE_ALIAS("ipt_MARK");
369 MODULE_ALIAS("ip6t_MARK");
371 +static inline u_int16_t
372 +get_dst_port(struct nf_conntrack_tuple *tuple)
374 + switch (tuple->dst.protonum) {
376 + /* XXX Truncate 32-bit GRE key to 16 bits */
377 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
378 + return tuple->dst.u.gre.key;
380 + return htons(ntohl(tuple->dst.u.gre.key));
383 + /* Bind on ICMP echo ID */
384 + return tuple->src.u.icmp.id;
386 + return tuple->dst.u.tcp.port;
388 + return tuple->dst.u.udp.port;
390 + return tuple->dst.u.all;
394 +static inline u_int16_t
395 +get_src_port(struct nf_conntrack_tuple *tuple)
397 + switch (tuple->dst.protonum) {
399 + /* XXX Truncate 32-bit GRE key to 16 bits */
400 + return htons(ntohl(tuple->src.u.gre.key));
402 + /* Bind on ICMP echo ID */
403 + return tuple->src.u.icmp.id;
405 + return tuple->src.u.tcp.port;
407 + return tuple->src.u.udp.port;
409 + return tuple->src.u.all;
414 target_v0(struct sk_buff **pskb,
415 const struct net_device *in,
416 @@ -44,7 +91,7 @@ target_v1(struct sk_buff **pskb,
417 const void *targinfo)
419 const struct xt_mark_target_info_v1 *markinfo = targinfo;
423 switch (markinfo->mode) {
425 @@ -58,9 +105,52 @@ target_v1(struct sk_buff **pskb,
427 mark = (*pskb)->mark | markinfo->mark;
430 + case XT_MARK_COPYXID: {
431 + enum ip_conntrack_info ctinfo;
432 + struct sock *connection_sk;
435 + struct nf_conn *ct = nf_ct_get((*pskb), &ctinfo);
436 + extern struct inet_hashinfo tcp_hashinfo;
437 + enum ip_conntrack_dir dir;
441 + dir = CTINFO2DIR(ctinfo);
442 + u_int32_t src_ip = ct->tuplehash[dir].tuple.src.u3.ip;
443 + u_int16_t src_port = get_src_port(&ct->tuplehash[dir].tuple);
448 + dif = ((struct rtable *)(*pskb)->dst)->rt_iif;
449 + ip = ct->tuplehash[dir].tuple.dst.u3.ip;
450 + port = get_dst_port(&ct->tuplehash[dir].tuple);
453 + connection_sk = (*pskb)->sk;
455 + connection_sk = inet_lookup(&tcp_hashinfo, src_ip, src_port, ip, port, dif);
458 + if (connection_sk) {
459 +#ifdef REQUIRESFIXFROMSAPAN
460 + connection_sk->sk_peercred.gid = connection_sk->sk_peercred.uid = ct->xid[dir];
461 + ct->xid[!dir]=connection_sk->sk_xid;
462 + /*connection_sk->sk_peercred.gid = connection_sk->sk_peercred.uid = connection_sk->sk_xid;*/
463 + if (connection_sk->sk_xid != 0)
464 + mark = connection_sk->sk_xid;
466 + if (connection_sk != (*pskb)->sk)
467 + sock_put(connection_sk);
473 - (*pskb)->mark = mark;
475 + (*pskb)->mark = mark;
479 @@ -92,7 +182,8 @@ checkentry_v1(const char *tablename,
481 if (markinfo->mode != XT_MARK_SET
482 && markinfo->mode != XT_MARK_AND
483 - && markinfo->mode != XT_MARK_OR) {
484 + && markinfo->mode != XT_MARK_OR
485 + && markinfo->mode != XT_MARK_COPYXID) {
486 printk(KERN_WARNING "MARK: unknown mode %u\n",
489 diff -Nurp linux-2.6.22-510/net/netfilter/xt_SETXID.c linux-2.6.22-520/net/netfilter/xt_SETXID.c
490 --- linux-2.6.22-510/net/netfilter/xt_SETXID.c 1969-12-31 19:00:00.000000000 -0500
491 +++ linux-2.6.22-520/net/netfilter/xt_SETXID.c 2007-12-03 15:11:08.000000000 -0500
493 +#include <linux/module.h>
494 +#include <linux/skbuff.h>
495 +#include <linux/ip.h>
496 +#include <net/checksum.h>
497 +#include <linux/vs_network.h>
499 +#include <linux/netfilter/x_tables.h>
500 +#include <linux/netfilter/xt_SETXID.h>
502 +MODULE_LICENSE("GPL");
504 +MODULE_DESCRIPTION("");
505 +MODULE_ALIAS("ipt_SETXID");
508 +target_v1(struct sk_buff **pskb,
509 + const struct net_device *in,
510 + const struct net_device *out,
511 + unsigned int hooknum,
512 + const struct xt_target *target,
513 + const void *targinfo)
515 + const struct xt_setxid_target_info_v1 *setxidinfo = targinfo;
517 + switch (setxidinfo->mode) {
518 + case XT_SET_PACKET_XID:
519 + (*pskb)->skb_tag = setxidinfo->mark;
522 + return XT_CONTINUE;
527 +checkentry_v1(const char *tablename,
529 + const struct xt_target *target,
531 + unsigned int hook_mask)
533 + struct xt_setxid_target_info_v1 *setxidinfo = targinfo;
535 + if (setxidinfo->mode != XT_SET_PACKET_XID) {
536 + printk(KERN_WARNING "SETXID: unknown mode %u\n",
544 +static struct xt_target xt_setxid_target[] = {
549 + .checkentry = checkentry_v1,
550 + .target = target_v1,
551 + .targetsize = sizeof(struct xt_setxid_target_info_v1),
557 +static int __init init(void)
561 + err = xt_register_targets(xt_setxid_target, ARRAY_SIZE(xt_setxid_target));
565 +static void __exit fini(void)
567 + xt_unregister_targets(xt_setxid_target, ARRAY_SIZE(xt_setxid_target));
572 diff -Nurp linux-2.6.22-510/net/packet/af_packet.c linux-2.6.22-520/net/packet/af_packet.c
573 --- linux-2.6.22-510/net/packet/af_packet.c 2007-07-21 18:00:27.000000000 -0400
574 +++ linux-2.6.22-520/net/packet/af_packet.c 2007-12-03 15:11:08.000000000 -0500
576 #include <linux/poll.h>
577 #include <linux/module.h>
578 #include <linux/init.h>
579 +#include <linux/vs_network.h>
582 #include <net/inet_common.h>
583 @@ -420,6 +421,10 @@ static inline unsigned int run_filter(st
586 struct sk_filter *filter;
587 + int tag = skb->skb_tag;
589 + if (sk->sk_nx_info && !(tag == 1 || sk->sk_nid == tag))
593 filter = rcu_dereference(sk->sk_filter);
594 @@ -984,7 +989,7 @@ static int packet_create(struct socket *
595 __be16 proto = (__force __be16)protocol; /* weird, but documented */
598 - if (!capable(CAP_NET_RAW))
599 + if (!nx_capable(CAP_NET_RAW, NXC_RAW_SEND))
601 if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW &&
602 sock->type != SOCK_PACKET)