aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_steering.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/srv6/sr_steering.c')
-rwxr-xr-xsrc/vnet/srv6/sr_steering.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/vnet/srv6/sr_steering.c b/src/vnet/srv6/sr_steering.c
index 566ba1fe5a0..aa98a45d3da 100755
--- a/src/vnet/srv6/sr_steering.c
+++ b/src/vnet/srv6/sr_steering.c
@@ -146,14 +146,11 @@ sr_steering_policy (int is_del, ip6_address_t * bsid, u32 sr_policy_index,
/* Remove promiscous mode from interface */
vnet_main_t *vnm = vnet_get_main ();
- ethernet_main_t *em = &ethernet_main;
- ethernet_interface_t *eif =
- ethernet_get_interface (em, sw_if_index);
-
- if (!eif)
- goto cleanup_error_redirection;
-
- ethernet_set_flags (vnm, sw_if_index, 0);
+ vnet_hw_interface_t *hi =
+ vnet_get_sup_hw_interface (vnm, sw_if_index);
+ /* Make sure it is main interface */
+ if (hi->sw_if_index == sw_if_index)
+ ethernet_set_flags (vnm, hi->hw_if_index, 0);
}
/* Delete SR steering policy entry */
@@ -289,14 +286,11 @@ sr_steering_policy (int is_del, ip6_address_t * bsid, u32 sr_policy_index,
/* Set promiscous mode on interface */
vnet_main_t *vnm = vnet_get_main ();
- ethernet_main_t *em = &ethernet_main;
- ethernet_interface_t *eif = ethernet_get_interface (em, sw_if_index);
-
- if (!eif)
- goto cleanup_error_redirection;
-
- ethernet_set_flags (vnm, sw_if_index,
- ETHERNET_INTERFACE_FLAG_ACCEPT_ALL);
+ vnet_hw_interface_t *hi = vnet_get_sup_hw_interface (vnm, sw_if_index);
+ /* Make sure it is main interface */
+ if (hi->sw_if_index == sw_if_index)
+ ethernet_set_flags (vnm, hi->hw_if_index,
+ ETHERNET_INTERFACE_FLAG_ACCEPT_ALL);
}
else if (traffic_type == SR_STEER_IPV4)
if (!sr_policy->is_encap)