All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [RFC,PATCH] sequence numbering for ctnetlink events
Date: Tue, 06 Jun 2006 19:02:36 +0200	[thread overview]
Message-ID: <4485B52C.7020207@netfilter.org> (raw)

[-- 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;

             reply	other threads:[~2006-06-06 17:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-06 17:02 Pablo Neira Ayuso [this message]
2006-06-19 16:36 ` [RFC,PATCH] sequence numbering for ctnetlink events Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4485B52C.7020207@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.