Skip to content

Commit

Permalink
Handle unicast ARP requests in source compute node
Browse files Browse the repository at this point in the history
Currently the unicast ARP requests are not processed in the source
compute node. These packets are switched to the destination compute node
and before handing the L2 packet to destined VM, these are processed.
This can result in Ecmp source VM sending unicast ARP requests and
destination VM (non ecmp) responding with Vhost MAC.

As a fix, unicast ARP requests are also processed in source compute node
itself

closes-bug: #1618154

Change-Id: Ic3a456f49297b982da79acc669982909ba2df74a
  • Loading branch information
divakardhar committed Sep 3, 2016
1 parent 24d26ed commit c780ca3
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions dp-core/vr_bridge.c
Expand Up @@ -472,13 +472,16 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt,
dmac = (int8_t *) pkt_data(pkt);

pull_len = 0;
if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6)) {
if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6) ||
(pkt->vp_type == VP_TYPE_ARP)) {
pull_len = pkt_get_network_header_off(pkt) - pkt_head_space(pkt);
if (pull_len && !pkt_pull(pkt, pull_len)) {
vr_pfree(pkt, VP_DROP_PULL);
return 0;
}
}

if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6)) {
if (fmd->fmd_dscp < 0) {
if (pkt->vp_type == VP_TYPE_IP) {
fmd->fmd_dscp =
Expand All @@ -488,7 +491,6 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt,
vr_inet6_get_tos((struct vr_ip6 *)pkt_network_header(pkt));
}
}

} else {
if (fmd->fmd_dotonep < 0) {
fmd->fmd_dotonep = vr_vlan_get_tos(pkt_data(pkt));
Expand All @@ -497,7 +499,6 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt,

/* Do the bridge lookup for the packets not meant for "me" */
if (!fmd->fmd_to_me) {

/*
* If DHCP packet coming from VM, Trap it to Agent before doing the bridge
* lookup itself
Expand All @@ -514,6 +515,26 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt,
return 0;
}
}

/*
* Handle the unicast ARP, coming from VM, not
* destined to us. Broadcast ARP requests would be handled
* in L2 multicast nexthop. Multicast ARP on fabric
* interface also would be handled in L2 multicast nexthop.
* Unicast ARP packets on fabric interface would be handled
* in plug routines of interface.
*/
if (!IS_MAC_BMCAST(dmac)) {
handled = 0;
if (pkt->vp_type == VP_TYPE_ARP) {
handled = vr_arp_input(pkt, fmd, dmac);
} else if (l4_type == L4_TYPE_NEIGHBOUR_SOLICITATION) {
handled = vr_neighbor_input(pkt, fmd, dmac);
}

if (handled)
return 0;
}
}

rt.rtr_req.rtr_label_flags = 0;
Expand Down

0 comments on commit c780ca3

Please sign in to comment.