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

Change-Id: I7ff8e0b4a5b9fc8abf777e32ed4ef8aeeb4358d6
closes-bug: #1618154
  • Loading branch information
divakardhar committed Sep 3, 2016
1 parent a20d45b commit 7145759
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions dp-core/vr_bridge.c
Expand Up @@ -472,7 +472,8 @@ 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);
Expand All @@ -482,7 +483,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 @@ -499,6 +499,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 7145759

Please sign in to comment.