Change-Id: I5bd0721b70dfc240fa9225df3704774f6b0ede81
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
gid_address_copy (&a->rmt_eid, rmt_eid);
a->vni = gid_address_vni (&a->rmt_eid);
gid_address_copy (&a->rmt_eid, rmt_eid);
a->vni = gid_address_vni (&a->rmt_eid);
+ a->is_src_dst = is_src_dst;
/* get vrf or bd_index associated to vni */
type = gid_address_type (&a->rmt_eid);
/* get vrf or bd_index associated to vni */
type = gid_address_type (&a->rmt_eid);
u8 is_add;
/** type of mapping */
u8 is_add;
/** type of mapping */
+ if (!lfe->is_src_dst)
+ {
+ /* install normal destination route if not src/dst and be done */
+ ip_src_fib_add_route (lfe->eid_fib_index,
+ &lfe->key->rmt.ippref, lfe->paths);
+ return;
+ }
+
dproto = (ip_prefix_version (&lfe->key->rmt.ippref) == IP4 ?
DPO_PROTO_IP4 : DPO_PROTO_IP6);
dproto = (ip_prefix_version (&lfe->key->rmt.ippref) == IP4 ?
DPO_PROTO_IP4 : DPO_PROTO_IP6);
static void
delete_fib_entries (lisp_gpe_fwd_entry_t * lfe)
{
static void
delete_fib_entries (lisp_gpe_fwd_entry_t * lfe)
{
- ip_src_dst_fib_del_route (lfe->src_fib_index,
- &lfe->key->lcl.ippref,
- lfe->eid_fib_index, &lfe->key->rmt.ippref);
+ fib_prefix_t dst_fib_prefix;
+
+ if (lfe->is_src_dst)
+ ip_src_dst_fib_del_route (lfe->src_fib_index,
+ &lfe->key->lcl.ippref,
+ lfe->eid_fib_index, &lfe->key->rmt.ippref);
+ else
+ {
+ ip_prefix_to_fib_prefix (&lfe->key->rmt.ippref, &dst_fib_prefix);
+ fib_table_entry_delete (lfe->src_fib_index, &dst_fib_prefix,
+ FIB_SOURCE_LISP);
+ }
}
static lisp_gpe_fwd_entry_t *
}
static lisp_gpe_fwd_entry_t *
lfe->eid_table_id = a->table_id;
lfe->eid_fib_index = fib_table_find_or_create_and_lock (fproto,
lfe->eid_table_id);
lfe->eid_table_id = a->table_id;
lfe->eid_fib_index = fib_table_find_or_create_and_lock (fproto,
lfe->eid_table_id);
+ lfe->is_src_dst = a->is_src_dst;
if (LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE != lfe->type)
{
if (LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE != lfe->type)
{
}
create_fib_entries (lfe);
}
create_fib_entries (lfe);
*/
typedef struct lisp_gpe_fwd_entry_t_
{
*/
typedef struct lisp_gpe_fwd_entry_t_
{
+ /**
+ * Follows src/dst or dst only forwarding policy
+ */
+ u8 is_src_dst;
+
/**
* This object joins the FIB control plane graph to receive updates to
* for changes to the graph.
/**
* This object joins the FIB control plane graph to receive updates to
* for changes to the graph.