All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC,PATCH] sequence numbering for ctnetlink events
@ 2006-06-06 17:02 Pablo Neira Ayuso
  2006-06-19 16:36 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2006-06-06 17:02 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

Hi,

This patch adds sequence numbering for event messages generated by 
ctnetlink, it is still imcomplete (nf_conntrack_netlink).

I'm having tons of problems these days, and this makes everything really 
hard: my laptop died, so my home pc did, my mail at eurodev was down... 
so I'm reading netfilter mail from the archives and I have to spend some 
time to set up again a git tree to test my patches, and... recent debian 
kernels are broken with UML... :(

BTW: people.netfilter.org seems to be down :(

[-- Attachment #2: f --]
[-- Type: text/plain, Size: 1636 bytes --]

[RFC,PATCH] sequence numbering for ctnetlink events

This patch adds sequence numbering to ctnetlink event messages
send to userspace.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Index: net-2.6.18.git/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
--- net-2.6.18.git.orig/net/ipv4/netfilter/ip_conntrack_netlink.c	2006-06-06 16:08:59.000000000 +0200
+++ net-2.6.18.git/net/ipv4/netfilter/ip_conntrack_netlink.c	2006-06-06 16:55:44.000000000 +0200
@@ -304,6 +304,8 @@
 }
 
 #ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
+static atomic_t ip_conntrack_seq = ATOMIC_INIT(0);
+
 static int ctnetlink_conntrack_event(struct notifier_block *this,
                                      unsigned long events, void *ptr)
 {
@@ -349,7 +351,8 @@
 	b = skb->tail;
 
 	type |= NFNL_SUBSYS_CTNETLINK << 8;
-	nlh   = NLMSG_PUT(skb, 0, 0, type, sizeof(struct nfgenmsg));
+	nlh   = NLMSG_PUT(skb, 0, atomic_add_return(1, &ip_conntrack_seq), 
+			  type, sizeof(struct nfgenmsg));
 	nfmsg = NLMSG_DATA(nlh);
 
 	nlh->nlmsg_flags    = flags;
@@ -1239,6 +1242,8 @@
 }
 
 #ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
+static atomic_t ip_conntrack_exp_seq = ATOMIC_INIT(0);
+
 static int ctnetlink_expect_event(struct notifier_block *this,
 				  unsigned long events, void *ptr)
 {
@@ -1263,7 +1268,8 @@
 	b = skb->tail;
 
 	type |= NFNL_SUBSYS_CTNETLINK_EXP << 8;
-	nlh   = NLMSG_PUT(skb, 0, 0, type, sizeof(struct nfgenmsg));
+	nlh   = NLMSG_PUT(skb, 0, atomic_add_return(1, &ip_conntrack_exp_seq),
+			  type, sizeof(struct nfgenmsg));
 	nfmsg = NLMSG_DATA(nlh);
 
 	nlh->nlmsg_flags    = flags;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-19 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-06 17:02 [RFC,PATCH] sequence numbering for ctnetlink events Pablo Neira Ayuso
2006-06-19 16:36 ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.