gid_address_t eid;
u8 * dmac = gid_address_mac (&eid);
u8 eid_set = 0;
- u8 * s = 0;
u32 vni, action = ~0, p, w;
int rv;
vec_add1 (rlocs, rloc);
curr_rloc = &rlocs[vec_len (rlocs) - 1];
}
- else if (unformat (line_input, "action %s", &s))
- {
- if (!strcmp ((char *)s, "no-action"))
- action = LISP_NO_ACTION;
- if (!strcmp ((char *)s, "natively-forward"))
- action = LISP_FORWARD_NATIVE;
- if (!strcmp ((char *)s, "send-map-request"))
- action = LISP_SEND_MAP_REQUEST;
- else if (!strcmp ((char *)s, "drop"))
- action = LISP_DROP;
- else
- {
- clib_warning ("invalid action: '%s'", s);
- goto done;
- }
- }
+ else if (unformat (line_input, "action %U",
+ unformat_negative_mapping_action, &action))
+ ;
else
{
clib_warning ("parse error");
done:
vec_free (rlocs);
unformat_free (line_input);
- if (s)
- vec_free (s);
return error;
}
if (unformat (input, "%s", &s))
{
- int len = vec_len(s);
- clib_warning ("len = %d", len);
if (!strcmp ((char *) s, "no-action"))
action[0] = LISP_NO_ACTION;
- if (!strcmp ((char *) s, "natively-forward"))
+ else if (!strcmp ((char *) s, "natively-forward"))
action[0] = LISP_FORWARD_NATIVE;
- if (!strcmp ((char *) s, "send-map-request"))
+ else if (!strcmp ((char *) s, "send-map-request"))
action[0] = LISP_SEND_MAP_REQUEST;
else if (!strcmp ((char *) s, "drop"))
action[0] = LISP_DROP;
{
clib_warning("invalid action: '%s'", s);
action[0] = LISP_DROP;
- return 0;
}
}
else
return 0;
+ vec_free(s);
return 1;
}
/* clean tunnel termination and vni to sw_if_index binding */
vnip = hash_get(tuns->vni_by_sw_if_index, hi->sw_if_index);
+ if (0 == vnip)
+ {
+ clib_warning ("No vni associated to interface %d", hi->sw_if_index);
+ return;
+ }
hash_unset(tuns->sw_if_index_by_vni, vnip[0]);
hash_unset(tuns->vni_by_sw_if_index, hi->sw_if_index);
}