Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
L2 BD: introduce a BD interface on which to send UU packets
[vpp.git]
/
src
/
vnet
/
interface.c
diff --git
a/src/vnet/interface.c
b/src/vnet/interface.c
index
1e69ccb
..
5cbbbf9
100644
(file)
--- a/
src/vnet/interface.c
+++ b/
src/vnet/interface.c
@@
-42,6
+42,7
@@
#include <vnet/fib/ip6_fib.h>
#include <vnet/adj/adj.h>
#include <vnet/adj/adj_mcast.h>
#include <vnet/fib/ip6_fib.h>
#include <vnet/adj/adj.h>
#include <vnet/adj/adj_mcast.h>
+#include <vnet/l2/l2_input.h>
#define VNET_INTERFACE_SET_FLAGS_HELPER_IS_CREATE (1 << 0)
#define VNET_INTERFACE_SET_FLAGS_HELPER_WANT_REDISTRIBUTE (1 << 1)
#define VNET_INTERFACE_SET_FLAGS_HELPER_IS_CREATE (1 << 0)
#define VNET_INTERFACE_SET_FLAGS_HELPER_WANT_REDISTRIBUTE (1 << 1)
@@
-424,7
+425,7
@@
vnet_sw_interface_set_flags_helper (vnet_main_t * vnm, u32 sw_if_index,
}
}
}
}
- /* Donot change state for slave link of bonded interfaces */
+ /* Do
not change state for slave link of bonded interfaces */
if (si->flags & VNET_SW_INTERFACE_FLAG_BOND_SLAVE)
{
error = clib_error_return
if (si->flags & VNET_SW_INTERFACE_FLAG_BOND_SLAVE)
{
error = clib_error_return
@@
-649,10
+650,11
@@
vnet_delete_sw_interface (vnet_main_t * vnm, u32 sw_if_index)
{
config = vec_elt_at_index (l2input_main.configs, sw_if_index);
if (config->xconnect)
{
config = vec_elt_at_index (l2input_main.configs, sw_if_index);
if (config->xconnect)
- set_int_l2_mode (vm, vnm, MODE_L3, config->output_sw_if_index, 0,
0,
- 0, 0);
+ set_int_l2_mode (vm, vnm, MODE_L3, config->output_sw_if_index, 0,
+
L2_BD_PORT_TYPE_NORMAL,
0, 0);
if (config->xconnect || config->bridge)
if (config->xconnect || config->bridge)
- set_int_l2_mode (vm, vnm, MODE_L3, sw_if_index, 0, 0, 0, 0);
+ set_int_l2_mode (vm, vnm, MODE_L3, sw_if_index, 0,
+ L2_BD_PORT_TYPE_NORMAL, 0, 0);
}
vnet_clear_sw_interface_tag (vnm, sw_if_index);
}
vnet_clear_sw_interface_tag (vnm, sw_if_index);
@@
-1365,7
+1367,7
@@
vnet_interface_init (vlib_main_t * vm)
vlib_node_fn_registration_t *fnr = c->tx_fn_registrations;
int priority = -1;
vlib_node_fn_registration_t *fnr = c->tx_fn_registrations;
int priority = -1;
- /* to avoid confusion, please remove ".tx_function" stat
i
ement
+ /* to avoid confusion, please remove ".tx_function" statement
from VNET_DEVICE_CLASS() if using function candidates */
ASSERT (c->tx_function == 0);
from VNET_DEVICE_CLASS() if using function candidates */
ASSERT (c->tx_function == 0);
@@
-1501,12
+1503,14
@@
vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
if (hi->hw_address)
{
if (hi->hw_address)
{
+ u8 *old_address = vec_dup (hi->hw_address);
vnet_device_class_t *dev_class =
vnet_get_device_class (vnm, hi->dev_class_index);
if (dev_class->mac_addr_change_function)
{
error =
vnet_device_class_t *dev_class =
vnet_get_device_class (vnm, hi->dev_class_index);
if (dev_class->mac_addr_change_function)
{
error =
- dev_class->mac_addr_change_function (hi, (char *) mac_address);
+ dev_class->mac_addr_change_function (hi, old_address,
+ mac_address);
}
if (!error)
{
}
if (!error)
{
@@
-1515,7
+1519,7
@@
vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
hw_class = vnet_get_hw_interface_class (vnm, hi->hw_class_index);
if (NULL != hw_class->mac_addr_change_function)
hw_class = vnet_get_hw_interface_class (vnm, hi->hw_class_index);
if (NULL != hw_class->mac_addr_change_function)
- hw_class->mac_addr_change_function (hi,
(char *)
mac_address);
+ hw_class->mac_addr_change_function (hi,
old_address,
mac_address);
}
else
{
}
else
{
@@
-1523,6
+1527,7
@@
vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
clib_error_return (0,
"MAC Address Change is not supported on this interface");
}
clib_error_return (0,
"MAC Address Change is not supported on this interface");
}
+ vec_free (old_address);
}
else
{
}
else
{
@@
-1648,7
+1653,7
@@
default_update_adjacency (vnet_main_t * vnm, u32 sw_if_index, u32 ai)
case IP_LOOKUP_NEXT_ARP:
case IP_LOOKUP_NEXT_BCAST:
/*
case IP_LOOKUP_NEXT_ARP:
case IP_LOOKUP_NEXT_BCAST:
/*
- * default rew
ir
te in neighbour adj
+ * default rew
ri
te in neighbour adj
*/
adj_nbr_update_rewrite
(ai,
*/
adj_nbr_update_rewrite
(ai,