From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: [RFC,PATCH] sequence numbering for ctnetlink events Date: Tue, 06 Jun 2006 19:02:36 +0200 Message-ID: <4485B52C.7020207@netfilter.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070602020006030204060806" Cc: Netfilter Development Mailinglist Return-path: To: Patrick McHardy List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org This is a multi-part message in MIME format. --------------070602020006030204060806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 :( --------------070602020006030204060806 Content-Type: text/plain; name="f" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="f" [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 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; --------------070602020006030204060806--