netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <hawk@diku.dk>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Patrick McHardy <kaber@trash.net>,
	David Miller <davem@davemloft.net>,
	netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] iptables: new strict host model match
Date: Mon, 2 Mar 2009 14:42:33 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0903021427570.27363@ask.diku.dk> (raw)
In-Reply-To: <20090226175247.5e56910f@nehalam>

On Thu, 26 Feb 2009, Stephen Hemminger wrote:

> This is a simple little iptables match that can be used to create the Strong
> End System model, that router and other non-Linux customers expect. There
> are management and other applications that use ping and expect to only get
> a response when the interface with that address is up. Normally, a Linux
> system will respond to a packet that arrives for any of the system addresses
> independent of which link it arrives on.

Is this no almost the same as:

  echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore



> +static bool strict_mt(const struct sk_buff *skb, const struct xt_match_param *par)
> +{
> +	struct in_device *in_dev;
> +	bool ret;
> +
> +	rcu_read_lock();
> +	in_dev = __in_dev_get_rcu(skb->dev);
> +	ret = (in_dev && inet_addr_onlink(in_dev, ip_hdr(skb)->daddr, 0));

inet_addr_onlink() will call
  -> inet_ifa_match(ip_hdr(skb)->daddr, ifa)

arp_ignore = 1
  -> inet_confirm_addr(in_dev, 0, tip, RT_SCOPE_HOST)
     -> inet_ifa_match(tip, ifa)


Hilsen
   Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------

  parent reply	other threads:[~2009-03-02 13:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27  1:52 [PATCH] iptables: new strict host model match Stephen Hemminger
2009-02-27  3:16 ` Jan Engelhardt
2009-02-27  3:23   ` Stephen Hemminger
2009-02-27  8:30     ` Jozsef Kadlecsik
2009-02-28  1:53     ` Jan Engelhardt
2009-02-28  2:10       ` Stephen Hemminger
2009-02-28  8:27         ` Jan Engelhardt
2009-03-02 11:02 ` Patrick McHardy
2009-03-02 13:42 ` Jesper Dangaard Brouer [this message]
2009-03-02 13:46   ` Denys Fedoryschenko
2009-03-02 18:53   ` Stephen Hemminger
2009-03-02 22:12     ` 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=Pine.LNX.4.64.0903021427570.27363@ask.diku.dk \
    --to=hawk@diku.dk \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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).