public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David McCullough <david_mccullough@mcafee•com>
To: <netdev@vger•kernel.org>
Cc: David Miller <davem@davemloft•net>
Subject: [PATCH v2] net/ipv6/route.c: packets originating on device match lo
Date: Tue, 26 Jun 2012 11:42:26 +1000	[thread overview]
Message-ID: <20120626014226.GB3455@mcafee.com> (raw)


Hi all,

Fix to allow IPv6 packets originating locally to match rules with the "iff"
set to "lo".  This allows IPv6 rule matching work the same as it does for
IPv4.  From the iproute2 man page:

   iif NAME
		  select  the incoming device to match.  If the interface is loop‐
		  back, the rule only matches packets originating from this  host.
		  This  means that you may create separate routing tables for for‐
		  warded and local packets and, hence, completely segregate them.

Cheers,
Davidm

Signed-off-by: David McCullough <david_mccullough@mcafee•com>

diff -u -p -r1.1.1.59 route.c
--- linux-3.4/net/ipv6/route.c	21 May 2012 23:15:01 -0000	1.1.1.59
+++ linux-3.4/net/ipv6/route.c	26 Jun 2012 01:41:15 -0000
@@ -931,6 +931,8 @@ struct dst_entry * ip6_route_output(stru
 {
 	int flags = 0;
 
+	fl6->flowi6_iif = net->loopback_dev->ifindex;
+
 	if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr))
 		flags |= RT6_LOOKUP_F_IFACE;
 
 
-- 
David McCullough,      david_mccullough@mcafee•com,  Ph:+61 734352815
McAfee - SnapGear      http://www.mcafee.com         http://www.uCdot.org

             reply	other threads:[~2012-06-26  1:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26  1:42 David McCullough [this message]
2012-06-26  6:54 ` [PATCH v2] net/ipv6/route.c: packets originating on device match lo David Miller

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=20120626014226.GB3455@mcafee.com \
    --to=david_mccullough@mcafee$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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