From: David Ward <david.ward@ll.mit.edu>
To: <netdev@vger.kernel.org>
Cc: David Ward <david.ward@ll.mit.edu>, Patrick McHardy <kaber@trash.net>
Subject: [PATCHv2 2/2] macvlan: Send frames to AF_PACKET sockets attached to lowerdev
Date: Thu, 28 Apr 2011 20:22:32 -0400 [thread overview]
Message-ID: <1304036552-1589-3-git-send-email-david.ward@ll.mit.edu> (raw)
In-Reply-To: <1304036552-1589-1-git-send-email-david.ward@ll.mit.edu>
In bridge mode, unicast frames can be forwarded directly between macvlan
interfaces attached to the same lowerdev without calling dev_queue_xmit.
These frames should still be sent to any AF_PACKET sockets (network taps)
attached to the lowerdev.
Signed-off-by: David Ward <david.ward@ll.mit.edu>
---
drivers/net/macvlan.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 3ad5425..25c7632 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -238,7 +238,10 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
dest = macvlan_hash_lookup(port, eth->h_dest);
if (dest && dest->mode == MACVLAN_MODE_BRIDGE) {
unsigned int length = skb->len + ETH_HLEN;
- int ret = dest->forward(dest->dev, skb);
+ int ret = NET_RX_DROP;
+
+ dev_queue_xmit_nit(skb, vlan->lowerdev);
+ ret = dest->forward(dest->dev, skb);
macvlan_count_rx(dest, length,
ret == NET_RX_SUCCESS, 0);
--
1.7.4.4
prev parent reply other threads:[~2011-04-29 0:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 0:22 [PATCHv2 0/2] Resolve packet capturing on macvlan lowerdev David Ward
2011-04-29 0:22 ` [PATCHv2 1/2] net: Export dev_queue_xmit_nit for use by macvlan driver David Ward
2011-05-05 17:50 ` David Miller
2011-05-07 16:47 ` Ward, David - 0663 - MITLL
2011-04-29 0:22 ` David Ward [this message]
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=1304036552-1589-3-git-send-email-david.ward@ll.mit.edu \
--to=david.ward@ll.mit.edu \
--cc=kaber@trash.net \
--cc=netdev@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).