Skip to content

Commit

Permalink
Validate vif to device and device to vif linkage before using vif
Browse files Browse the repository at this point in the history
Once rps is done, the handler tries to extract vif from the control
block. From that vif we try to get the dev and the rx_handler_data
(which should be equal to the vif). From whatever information that
was present in the trace, it was confirmed that rx_handler_data was
null. There could be a case where agent restarts and is in the process
of soft resetting the vrouter when this condition can happen. Since
we do not have dump, for now we will check the linkages between vif
and device (<=>) before proceeding with packet processing.

Closes Bug: #1430279

Change-Id: I98066588c3c0d95f1327d505495f2058d9616a4d
  • Loading branch information
anandhk-juniper committed Mar 11, 2015
1 parent 6433c65 commit 0d16880
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion linux/vr_host_interface.c
Expand Up @@ -1074,7 +1074,9 @@ linux_rx_handler(struct sk_buff **pskb)
vif = __vrouter_get_interface(router,
((vr_rps_t *)skb->cb)->vif_idx);
if (vif && (vif->vif_type == VIF_TYPE_PHYSICAL) && vif->vif_os) {
dev = (struct net_device *) vif->vif_os;
dev = (struct net_device *)vif->vif_os;
if (!dev || (vif != rcu_dereference(dev->rx_handler_data)))
goto error;
rpsdev = 1;
} else {
goto error;
Expand Down

0 comments on commit 0d16880

Please sign in to comment.