Skip to content

Commit

Permalink
Strip vlan tags before sending to vhost interface
Browse files Browse the repository at this point in the history
Packets that are sent to vhost with tags will be dropped by the OS.
Hence, tags need to be stripped from such packets before sending it
to vhost interface.

Change-Id: I7d8ee96ee392b7f2ab61d5aca437c4124556e5d0
Closes-Bug: #1401880
  • Loading branch information
anandhk-juniper committed Mar 23, 2015
1 parent a701b0d commit 8532c2e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dp-core/vr_proto_ip.c
Expand Up @@ -330,12 +330,11 @@ vr_ip_rcv(struct vrouter *router, struct vr_packet *pkt,
}

/*
* IF the packet packet is from Vmware, it will be a tagged
* packet. This tagged packets if destined to Vhost, packet
* needs to be stripped of all tags
* If the packet is tagged (from a vlan interface or from the virtual
* vlan interfaces) and if it is destined to vhost, all tags need to
* be stripped.
*/
if (vif->vif_type == VIF_TYPE_HOST && pkt->vp_if->vif_type ==
VIF_TYPE_VIRTUAL_VLAN) {
if (vif->vif_type == VIF_TYPE_HOST) {

eth = pkt_data(pkt);
eth_proto = ntohs(*(unsigned short *)(eth +
Expand Down

0 comments on commit 8532c2e

Please sign in to comment.