From 0d32c5c070f817229110f92d7b31df9a3e4eeec5 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Sun, 24 Oct 2010 21:42:48 +0200 Subject: Fixes, cleanups, comments - More comments added to the code - ICMP and ICMPv6 support added to the hash:ip,port, hash:ip,port,ip and hash:ip,port,net types - hash:net and hash:ip,port,net types are reworked - hash:net,port type added - Wrong direction parameters fixed in hash:ip,port - Helps and manpage are updated - More tests added - Ugly macros are rewritten to functions in parse.c (Holger Eitzenberger) - resize related bug in hash types fixed (Holger Eitzenberger) - autoreconf patches by Jan Engelhardt applied - netlink patch minimalized: dumping can be initialized by a second parsing of the message (thanks to David and Patrick for the suggestion) - IPv4/IPv6 address attributes are introduced in order to fix the context (suggested by David) --- netlink.patch | 72 ----------------------------------------------------------- 1 file changed, 72 deletions(-) (limited to 'netlink.patch') diff --git a/netlink.patch b/netlink.patch index 344cfc8..b651d44 100644 --- a/netlink.patch +++ b/netlink.patch @@ -12,75 +12,3 @@ index 9f00da2..9f51ff6 100644 #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, -- const 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, -+ const 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, -- const 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, -+ const 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) - { -- cgit v1.2.3