Skip to content

Commit

Permalink
Mirroring the GARP packes rather trapping
Browse files Browse the repository at this point in the history
When the Agent puts the Trap flag in L3 route it expects the Garp
packets to be trapped to it. As of now, the packet is only getting
Trapped and not getting flooded when this flag is seen. As such, Garp
packet always need to be flooded irrespective of the Trap flag.

To fix this, when the Trap flag is seen in the L3 route, a copuy of Garp
packet is given to VM and original copy is flooded as well.

Change-Id: I586385e157cd221bfa21d879b7601ebfa00cd5c8
closes-bug: #1511237
  • Loading branch information
divakardhar committed Nov 5, 2015
1 parent 04cadf7 commit c2e31f8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions dp-core/vr_datapath.c
Expand Up @@ -250,8 +250,13 @@ vr_handle_arp_request(struct vr_arp *sarp, struct vr_packet *pkt,
vr_trap(pkt, fmd->fmd_dvrf, AGENT_TRAP_ARP, NULL);
break;

case MR_TRAP:
vr_trap(pkt, fmd->fmd_dvrf, AGENT_TRAP_ARP, NULL);
case MR_MIRROR:
pkt_c = vr_pclone(pkt);
if (pkt_c)
vr_trap(pkt_c, fmd->fmd_dvrf, AGENT_TRAP_ARP, NULL);

/* Flood the original packet*/
handled = false;
break;

case MR_DROP:
Expand Down
2 changes: 1 addition & 1 deletion dp-core/vr_proto_ip.c
Expand Up @@ -1047,7 +1047,7 @@ vm_arp_request(struct vr_interface *vif, struct vr_packet *pkt,

if (vr_grat_arp(sarp)) {
if (rt.rtr_req.rtr_label_flags & VR_RT_ARP_TRAP_FLAG)
return MR_TRAP;
return MR_MIRROR;
return MR_FLOOD;
}

Expand Down
8 changes: 6 additions & 2 deletions dp-core/vr_proto_ip6.c
Expand Up @@ -316,8 +316,12 @@ vr_neighbor_input(struct vr_packet *pkt, struct vr_forwarding_md *fmd)
vr_trap(pkt, fmd->fmd_dvrf, AGENT_TRAP_ARP, NULL);
break;

case MR_TRAP:
vr_trap(pkt, fmd->fmd_dvrf, AGENT_TRAP_ARP, NULL);
case MR_MIRROR:
pkt_c = vr_pclone(pkt);
if (pkt_c)
vr_trap(pkt_c, fmd->fmd_dvrf, AGENT_TRAP_ARP, NULL);

handled = false;
break;

case MR_DROP:
Expand Down
2 changes: 1 addition & 1 deletion include/vr_interface.h
Expand Up @@ -96,7 +96,7 @@ typedef enum {
MR_FLOOD,
MR_PROXY,
MR_NOT_ME,
MR_TRAP,
MR_MIRROR,
MR_TRAP_X,
MR_XCONNECT,
} mac_response_t;
Expand Down

0 comments on commit c2e31f8

Please sign in to comment.