diff --git a/linux/vhost_dev.c b/linux/vhost_dev.c index 65ab3cf70..78a9763c2 100644 --- a/linux/vhost_dev.c +++ b/linux/vhost_dev.c @@ -226,6 +226,15 @@ vhost_if_add(struct vr_interface *vif) vp->vp_vifp = vif; if (vif->vif_type == VIF_TYPE_HOST) { if (vif->vif_bridge) { + /* + * if there already was an association, need to remove that + */ + if ((vp->vp_phys_dev) && + (vp->vp_phys_dev != + ((struct net_device *)vif->vif_bridge->vif_os))) { + vhost_del_tap_phys(vp->vp_phys_dev); + } + vp->vp_phys_dev = (struct net_device *)vif->vif_bridge->vif_os; strncpy(vp->vp_phys_name, vp->vp_phys_dev->name, diff --git a/linux/vr_host_interface.c b/linux/vr_host_interface.c index d4d443a2d..a21b85d6b 100644 --- a/linux/vr_host_interface.c +++ b/linux/vr_host_interface.c @@ -1323,6 +1323,9 @@ vr_interface_common_hook(struct sk_buff *skb) vif = vr_get_vif_ptr(skb->dev); } + if (!vif) + goto error; + #if 0 if(vrouter_dbg) { __skb_dump_info("vr_intf_br_hk:", skb, vif);