netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Vosburgh <fubar@us.ibm.com>
To: Andy Gospodarek <andy@greyhouse.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Tom Herbert <therbert@google.com>,
	David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next-2.6] fix bonding: allow arp_ip_targets on separate vlans to use arp validation
Date: Wed, 06 Jan 2010 15:53:49 -0800	[thread overview]
Message-ID: <13683.1262822029@death.nxdomain.ibm.com> (raw)
In-Reply-To: <20100106225637.GC6490@gospo.rdu.redhat.com>

Andy Gospodarek <andy@greyhouse.net> wrote:

>This patch fixes up a problem with found with commit
>1f3c8804acba841b5573b953f5560d2683d2db0d.  The original change
>overloaded null_or_orig, but doing that prevented any packet handlers
>that were not tied to a specific device (i.e. ptype->dev == NULL) from
>ever receiving any frames.
>
>The null_or_orig variable cannot be overloaded, and must be kept as NULL
>to prevent the frame from being ignored by packet handlers designed to
>accept frames on any interface.
>
>Signed-off-by: Andy Gospodarek <andy@greyhouse.net>

	Tested, and it appears to work fine.  Tcpdump also appears to
behave rationally.

	-J

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>


>---
> dev.c |   11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
>diff --git a/net/core/dev.c b/net/core/dev.c
>index f9aa699..d9ab9be 100644
>--- a/net/core/dev.c
>+++ b/net/core/dev.c
>@@ -2430,6 +2430,7 @@ int netif_receive_skb(struct sk_buff *skb)
> 	struct packet_type *ptype, *pt_prev;
> 	struct net_device *orig_dev;
> 	struct net_device *null_or_orig;
>+	struct net_device *null_or_bond;
> 	int ret = NET_RX_DROP;
> 	__be16 type;
>
>@@ -2500,21 +2501,19 @@ ncls:
> 	 * bonding interfaces still make their way to any base bonding
> 	 * device that may have registered for a specific ptype.  The
> 	 * handler may have to adjust skb->dev and orig_dev.
>-	 *
>-	 * null_or_orig can be overloaded since it will not be set when
>-	 * using VLANs on top of bonding.  Putting it here prevents
>-	 * disturbing the ptype_all handlers above.
> 	 */
>+	null_or_bond = NULL;
> 	if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
> 	    (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
>-		null_or_orig = vlan_dev_real_dev(skb->dev);
>+		null_or_bond = vlan_dev_real_dev(skb->dev);
> 	}
>
> 	type = skb->protocol;
> 	list_for_each_entry_rcu(ptype,
> 			&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
> 		if (ptype->type == type && (ptype->dev == null_or_orig ||
>-		     ptype->dev == skb->dev || ptype->dev == orig_dev)) {
>+		     ptype->dev == skb->dev || ptype->dev == orig_dev ||
>+		     ptype->dev == null_or_bond)) {
> 			if (pt_prev)
> 				ret = deliver_skb(skb, pt_prev, orig_dev);
> 			pt_prev = ptype;
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-01-06 23:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 23:28 [PATCH v4 1/1] rps: core implementation Tom Herbert
2009-11-20 23:39 ` David Miller
2009-11-20 23:50   ` Tom Herbert
2009-11-21  0:05     ` David Miller
2009-11-21  0:12       ` Tom Herbert
2009-11-21  0:40         ` Jarek Poplawski
2009-11-20 23:40 ` Stephen Hemminger
2009-11-20 23:53   ` Tom Herbert
2009-11-20 23:56   ` David Miller
2009-12-17 21:04   ` Tom Herbert
2010-01-06  1:32     ` Tom Herbert
2010-01-06  5:54       ` Eric Dumazet
2010-01-06  7:56         ` Tom Herbert
2010-01-06 18:38         ` Eric Dumazet
2010-01-06 21:10           ` [BUG net-next-2.6] Had to revert bonding: allow arp_ip_targets on separate vlans to use arp validation Eric Dumazet
2010-01-06 21:28             ` Jay Vosburgh
2010-01-06 21:34               ` Eric Dumazet
2010-01-06 21:38             ` David Miller
2010-01-06 21:45               ` Andy Gospodarek
2010-01-06 22:56             ` [PATCH net-next-2.6] fix " Andy Gospodarek
2010-01-06 23:53               ` Jay Vosburgh [this message]
2010-01-07  8:37                 ` Eric Dumazet
2010-01-07  8:41                   ` David Miller
2010-01-06 22:54           ` [PATCH v4 1/1] rps: core implementation Tom Herbert
2010-01-07  9:15             ` Eric Dumazet
2010-01-07 17:42               ` rps: some comments Eric Dumazet
2010-01-08  0:07                 ` Tom Herbert
2010-01-08  6:27                   ` Eric Dumazet
2010-01-11  6:25               ` [PATCH v4 1/1] rps: core implementation Tom Herbert
2010-01-11  9:00                 ` Eric Dumazet
2010-01-14  4:40                   ` David Miller
2009-11-20 23:42 ` Stephen Hemminger
2009-11-21  0:04   ` Tom Herbert
2009-11-21  8:07 ` Eric Dumazet
2009-11-21  9:03   ` Tom Herbert
2009-11-21  9:31     ` Eric Dumazet

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=13683.1262822029@death.nxdomain.ibm.com \
    --to=fubar@us.ibm.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.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).