aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipvlan/ipvlan_core.c
diff options
context:
space:
mode:
authorMahesh Bandewar <maheshb@google.com>2017-10-26 18:09:25 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-29 05:39:57 -0400
commitfe89aa6b250c1011ccf425fbb7998e96bd54263f (patch)
tree35d21de9cf2d9e240a999597379d040aa9d1397f /drivers/net/ipvlan/ipvlan_core.c
parenta190d04db93710ae166749055b6985397c6d13f5 (diff)
ipvlan: implement VEPA mode
This is very similar to the Macvlan VEPA mode, however, there is some difference. IPvlan uses the mac-address of the lower device, so the VEPA mode has implications of ICMP-redirects for packets destined for its immediate neighbors sharing same master since the packets will have same source and dest mac. The external switch/router will send redirect msg. Having said that, this will be useful tool in terms of debugging since IPvlan will not switch packets within its slaves and rely completely on the external entity as intended in 802.1Qbg. Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_core.c')
-rw-r--r--drivers/net/ipvlan/ipvlan_core.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 72fd56de9c00..034ae4c57196 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -514,13 +514,15 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
514 if (!lyr3h) 514 if (!lyr3h)
515 goto out; 515 goto out;
516 516
517 addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true); 517 if (!ipvlan_is_vepa(ipvlan->port)) {
518 if (addr) { 518 addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true);
519 if (ipvlan_is_private(ipvlan->port)) { 519 if (addr) {
520 consume_skb(skb); 520 if (ipvlan_is_private(ipvlan->port)) {
521 return NET_XMIT_DROP; 521 consume_skb(skb);
522 return NET_XMIT_DROP;
523 }
524 return ipvlan_rcv_frame(addr, &skb, true);
522 } 525 }
523 return ipvlan_rcv_frame(addr, &skb, true);
524 } 526 }
525out: 527out:
526 ipvlan_skb_crossing_ns(skb, ipvlan->phy_dev); 528 ipvlan_skb_crossing_ns(skb, ipvlan->phy_dev);
@@ -535,7 +537,8 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
535 void *lyr3h; 537 void *lyr3h;
536 int addr_type; 538 int addr_type;
537 539
538 if (ether_addr_equal(eth->h_dest, eth->h_source)) { 540 if (!ipvlan_is_vepa(ipvlan->port) &&
541 ether_addr_equal(eth->h_dest, eth->h_source)) {
539 lyr3h = ipvlan_get_L3_hdr(skb, &addr_type); 542 lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
540 if (lyr3h) { 543 if (lyr3h) {
541 addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true); 544 addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true);