aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/gre
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-01-06 20:36:14 +0100
committerOle Tr�an <otroan@employees.org>2022-01-07 12:49:47 +0000
commit5c954c4641c7894636aa0533634ef4f5a6bed615 (patch)
treeee3cbeb1e94fadda57aa8620eacfc30d16b7b1df /src/vnet/gre
parentc58b1747b34fe1987835f68268218779a81ae3db (diff)
ethernet: new interface registration function
Prep for supporting multiple callbacks, optional args, etc. Type: improvement Change-Id: I96244c098712e8213374678623f12527b0e7f387 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/gre')
-rw-r--r--src/vnet/gre/interface.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/vnet/gre/interface.c b/src/vnet/gre/interface.c
index 3b566b6ea81..4a02aa77292 100644
--- a/src/vnet/gre/interface.c
+++ b/src/vnet/gre/interface.c
@@ -370,7 +370,6 @@ vnet_gre_tunnel_add (vnet_gre_tunnel_add_del_args_t * a,
gre_tunnel_t *t;
vnet_hw_interface_t *hi;
u32 hw_if_index, sw_if_index;
- clib_error_t *error;
u8 is_ipv6 = a->is_ipv6;
gre_tunnel_key_t key;
@@ -415,17 +414,16 @@ vnet_gre_tunnel_add (vnet_gre_tunnel_add_del_args_t * a,
}
else
{
+ vnet_eth_interface_registration_t eir = {};
+
/* Default MAC address (d00b:eed0:0000 + sw_if_index) */
u8 address[6] =
{ 0xd0, 0x0b, 0xee, 0xd0, (u8) (t_idx >> 8), (u8) t_idx };
- error =
- ethernet_register_interface (vnm, gre_device_class.index, t_idx,
- address, &hw_if_index, 0);
- if (error)
- {
- clib_error_report (error);
- return VNET_API_ERROR_INVALID_REGISTRATION;
- }
+
+ eir.dev_class_index = gre_device_class.index;
+ eir.dev_instance = t_idx;
+ eir.address = address;
+ hw_if_index = vnet_eth_register_interface (vnm, &eir);
}
/* Set GRE tunnel interface output node (not used for L3 payload) */