netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Murat Sezgin" <msezgin@codeaurora.org>
To: <netfilter-devel@vger.kernel.org>
Subject: route table change events
Date: Thu, 5 Nov 2015 16:48:30 -0800	[thread overview]
Message-ID: <002701d1182c$db558e60$9200ab20$@codeaurora.org> (raw)

Hi all,

In the netfilter conntrack framework, is there a route table change event
handler like netdevice event handler? 

I am reading 3.4 and 3.14 kernels, but I couldn't find any, and I
implemented my own notification registration in routing code and a handler
in my own kernel module. With this handler, if there is any change in route
table, (add or remove), an event notify my module and I clean all the
conntrack entires which are created on each netdevice in the system.

I use a code in my block notifier handler something like below:

for_each_netdevice(&init_net, dev) {
	nf_ct_iterate_cleanup(&init_net, device_cmp, (void
*)(long)dev->ifindex);
}

I clean up all the conntrack entries, because it is possible that the newly
added route wants to send the traffic through another interface in the
system. If we don't delete the conntrack entry, the old source NAT address
would be remain in the conntrack table for that flow.

Regards,
Murat


                 reply	other threads:[~2015-11-06  0:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='002701d1182c$db558e60$9200ab20$@codeaurora.org' \
    --to=msezgin@codeaurora.org \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).