diff options
author | Florin Coras <fcoras@cisco.com> | 2016-06-23 15:01:58 +0200 |
---|---|---|
committer | Chris Luke <chris_luke@comcast.com> | 2016-07-04 18:48:50 +0000 |
commit | f727db9e6fb50b2930aedf18bcdda55fe0b96889 (patch) | |
tree | b2aeced07a924e4fdf62716faa6c6cb1b3e56a5a /vnet/vnet/lisp-cp/lisp_msg_serdes.c | |
parent | 7d54a3d120207b4a49a01b3b60ff6545499f1cb7 (diff) |
LISP CP cleanup and refactoring
- avoid code duplication by using only one function for
insertion/updating of remote mappings into map-cache. Static remote
mappings are now inserted using this function as well and therefore
the code does not try to build forwarding entries out of them now.
- bring up lisp dp interfaces when a vni is bound to a vrf.
- ensure eids are cleaned-up before parsing control plane messages
- ensure map-requests are always sent to default fib
- new API to insert lisp adjacencies as opposed to remote mappings which
should be replaced post merged in CSIT
- reorganize and group functions according to their purpose and use. No
need to pre-declare internal functions now.
- this does not touch locator-set logic
Change-Id: Ibcfc0f2d9c1bc1c9eab6e83c1af1b4cf9302ac10
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'vnet/vnet/lisp-cp/lisp_msg_serdes.c')
-rw-r--r-- | vnet/vnet/lisp-cp/lisp_msg_serdes.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vnet/vnet/lisp-cp/lisp_msg_serdes.c b/vnet/vnet/lisp-cp/lisp_msg_serdes.c index 6c5546014b1..c1713b36c99 100644 --- a/vnet/vnet/lisp-cp/lisp_msg_serdes.c +++ b/vnet/vnet/lisp-cp/lisp_msg_serdes.c @@ -149,7 +149,9 @@ lisp_msg_pull_hdr (vlib_buffer_t * b, lisp_msg_type_e type) u32 lisp_msg_parse_addr (vlib_buffer_t * b, gid_address_t * eid) { - u32 len = gid_address_parse (vlib_buffer_get_current (b), eid); + u32 len; + memset(eid, 0, sizeof(*eid)); + len = gid_address_parse (vlib_buffer_get_current (b), eid); if (len != ~0) vlib_buffer_pull (b, len); return len; @@ -159,7 +161,9 @@ u32 lisp_msg_parse_eid_rec (vlib_buffer_t * b, gid_address_t * eid) { eid_record_hdr_t * h = vlib_buffer_get_current (b); - u32 len = gid_address_parse (EID_REC_ADDR(h), eid); + u32 len; + memset(eid, 0, sizeof(*eid)); + len = gid_address_parse (EID_REC_ADDR(h), eid); if (len == ~0) return len; @@ -213,6 +217,7 @@ lisp_msg_parse_mapping_record (vlib_buffer_t * b, gid_address_t * eid, h = vlib_buffer_get_current (b); vlib_buffer_pull (b, sizeof(mapping_record_hdr_t)); + memset(eid, 0, sizeof(*eid)); len = gid_address_parse (vlib_buffer_get_current (b), eid); if (len == ~0) return len; |