aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/gbp/gbp_vxlan.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-04 14:08:11 -0800
committerNeale Ranns <nranns@cisco.com>2019-03-06 10:31:38 +0000
commit8da9fc659badc016e409f772673002f021c0cc4a (patch)
tree0223180b7344b652ab8c45bb38f47f335bbed7c5 /src/plugins/gbp/gbp_vxlan.c
parentdc8d93b02949f508d5eed312a51aa91102224b39 (diff)
GBP: learn from ARP and L2 packets
Change-Id: I8af7bca566ec7c9bd2b72529d49e04c6e649b44a Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_vxlan.c')
-rw-r--r--src/plugins/gbp/gbp_vxlan.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/gbp/gbp_vxlan.c b/src/plugins/gbp/gbp_vxlan.c
index 846ea0fa6ff..c0e88fdda8e 100644
--- a/src/plugins/gbp/gbp_vxlan.c
+++ b/src/plugins/gbp/gbp_vxlan.c
@@ -465,7 +465,8 @@ VNET_HW_INTERFACE_CLASS (gbp_vxlan_hw_interface_class) = {
int
gbp_vxlan_tunnel_add (u32 vni, gbp_vxlan_tunnel_layer_t layer,
- u32 bd_rd_id, u32 * sw_if_indexp)
+ u32 bd_rd_id,
+ const ip4_address_t * src, u32 * sw_if_indexp)
{
gbp_vxlan_tunnel_t *gt;
index_t gti;
@@ -512,6 +513,7 @@ gbp_vxlan_tunnel_add (u32 vni, gbp_vxlan_tunnel_layer_t layer,
gt->gt_vni = vni;
gt->gt_layer = layer;
gt->gt_bd_rd_id = bd_rd_id;
+ gt->gt_src.ip4.as_u32 = src->as_u32;
gt->gt_hw_if_index = vnet_register_interface (vnm,
gbp_vxlan_device_class.index,
gti,
@@ -534,7 +536,7 @@ gbp_vxlan_tunnel_add (u32 vni, gbp_vxlan_tunnel_layer_t layer,
gt->gt_gbd = gbi;
gt->gt_bd_index = gb->gb_bd_index;
- gb->gb_vni_sw_if_index = gt->gt_sw_if_index;
+ gb->gb_vni = gti;
/* set it up as a GBP interface */
gt->gt_itf = gbp_itf_add_and_lock (gt->gt_sw_if_index,
gt->gt_bd_index);
@@ -571,7 +573,8 @@ gbp_vxlan_tunnel_add (u32 vni, gbp_vxlan_tunnel_layer_t layer,
*/
hash_set (gv_db, vni, gti);
- vec_validate (gbp_vxlan_tunnel_db, gt->gt_sw_if_index);
+ vec_validate_init_empty (gbp_vxlan_tunnel_db,
+ gt->gt_sw_if_index, INDEX_INVALID);
gbp_vxlan_tunnel_db[gt->gt_sw_if_index] = gti;
if (sw_if_indexp)