summaryrefslogtreecommitdiffstats
path: root/netlink.patch-2.6.31.1
diff options
context:
space:
mode:
Diffstat (limited to 'netlink.patch-2.6.31.1')
-rw-r--r--netlink.patch-2.6.31.186
1 files changed, 86 insertions, 0 deletions
diff --git a/netlink.patch-2.6.31.1 b/netlink.patch-2.6.31.1
new file mode 100644
index 0000000..2caed0b
--- /dev/null
+++ b/netlink.patch-2.6.31.1
@@ -0,0 +1,86 @@
+diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
+index 9f00da2..9f51ff6 100644
+--- a/include/linux/netfilter/nfnetlink.h
++++ b/include/linux/netfilter/nfnetlink.h
+@@ -47,7 +47,8 @@ struct nfgenmsg {
+ #define NFNL_SUBSYS_QUEUE 3
+ #define NFNL_SUBSYS_ULOG 4
+ #define NFNL_SUBSYS_OSF 5
+-#define NFNL_SUBSYS_COUNT 6
++#define NFNL_SUBSYS_IPSET 6
++#define NFNL_SUBSYS_COUNT 7
+
+ #ifdef __KERNEL__
+
+diff --git a/include/linux/netlink.h b/include/linux/netlink.h
+index ab5d312..ef8b229 100644
+--- a/include/linux/netlink.h
++++ b/include/linux/netlink.h
+@@ -263,11 +263,14 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
+ #define NLMSG_PUT(skb, pid, seq, type, len) \
+ NLMSG_NEW(skb, pid, seq, type, len, 0)
+
+-extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
+- struct nlmsghdr *nlh,
+- int (*dump)(struct sk_buff *skb, struct netlink_callback*),
+- int (*done)(struct netlink_callback*));
+-
++extern int netlink_dump_init(struct sock *ssk, struct sk_buff *skb,
++ struct nlmsghdr *nlh,
++ int (*dump)(struct sk_buff *skb, struct netlink_callback*),
++ int (*done)(struct netlink_callback*),
++ unsigned char init, ...);
++
++#define netlink_dump_start(ssk, skb, nlh, dump, done) \
++ netlink_dump_init(ssk, skb, nlh, dump, done, 0)
+
+ #define NL_NONROOT_RECV 0x1
+ #define NL_NONROOT_SEND 0x2
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
+index 19e9800..7d85d45 100644
+--- a/net/netlink/af_netlink.c
++++ b/net/netlink/af_netlink.c
+@@ -1714,15 +1714,18 @@ errout:
+ return err;
+ }
+
+-int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
+- struct nlmsghdr *nlh,
+- int (*dump)(struct sk_buff *skb,
+- struct netlink_callback *),
+- int (*done)(struct netlink_callback *))
++int netlink_dump_init(struct sock *ssk, struct sk_buff *skb,
++ struct nlmsghdr *nlh,
++ int (*dump)(struct sk_buff *skb,
++ struct netlink_callback *),
++ int (*done)(struct netlink_callback *),
++ unsigned char init, ...)
+ {
+ struct netlink_callback *cb;
+ struct sock *sk;
+ struct netlink_sock *nlk;
++ va_list args;
++ unsigned char i;
+
+ cb = kzalloc(sizeof(*cb), GFP_KERNEL);
+ if (cb == NULL)
+@@ -1733,6 +1736,10 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
+ cb->nlh = nlh;
+ atomic_inc(&skb->users);
+ cb->skb = skb;
++ va_start(args, init);
++ for (i = 0; i < init; i++)
++ cb->args[i] = va_arg(args, long);
++ va_end(args);
+
+ sk = netlink_lookup(sock_net(ssk), ssk->sk_protocol, NETLINK_CB(skb).pid);
+ if (sk == NULL) {
+@@ -1759,7 +1766,7 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
+ */
+ return -EINTR;
+ }
+-EXPORT_SYMBOL(netlink_dump_start);
++EXPORT_SYMBOL(netlink_dump_init);
+
+ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
+ {