+ if (INDEX_INVALID == t_idx)
+ return;
+
+ /* entry has been added on an interface for which there is a GRE tunnel */
+ t = pool_elt_at_index (gm->tunnels, t_idx);
+
+ if (t->mode != TUNNEL_MODE_MP)
+ return;
+
+ /* the next-hop (underlay) of the NHRP entry will form part of the key for
+ * ingress lookup to match packets to this interface */
+ gre_teib_mk_key (t, ne, &key);
+ gre_tunnel_db_add (t, &key);
+
+ /* update the rewrites for each of the adjacencies for this peer (overlay)
+ * using the next-hop (underlay) */
+ mgre_walk_ctx_t ctx = {
+ .t = t,
+ .ne = ne
+ };
+ nh = teib_entry_get_peer (ne);
+ adj_nbr_walk_nh (teib_entry_get_sw_if_index (ne),
+ (ip46_address_is_ip4 (nh) ?
+ FIB_PROTOCOL_IP4 :
+ FIB_PROTOCOL_IP6), nh, mgre_mk_complete_walk, &ctx);