aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/lisp-cp/lisp_msg_serdes.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-07-22 01:45:30 +0200
committerFlorin Coras <fcoras@cisco.com>2016-07-31 15:52:42 +0200
commit1a1adc7121e698743a64141373966041efc5f2e7 (patch)
tree1ebc8b57943f706ae2ac3268e631e8c07d43b3f2 /vnet/vnet/lisp-cp/lisp_msg_serdes.c
parentd038dbf4aa42781a3962326eb49235b04a95f416 (diff)
Initial L2 LISP support
This introduces support for layer 2 overlays with LISP. Similarly to L3, all tenant packets to be encapsulated are captured by an interface, but the mapping (layer binding) instead of being between an L3 VRF and a LISP VNI, it is between and an L2 bridge domain and a VNI. At a high level, this results in two important properties: 1) the source and destinations of all packets flooded in the bridge-domain are mapped via the LISP control plane and the replies are converted into data-plane tunnels tracked via a LISP specific source/dest L2 FIB 2) All packets reaching the interface and matching a source/dest L2 LISP FIB entry are L3 (IP4/6) encapsulated. This is solely a unicast feature, therefore at this time ARPs are not handled in any special way. Change-Id: I0b7badcd7c6d5166db07d4acd2cc4ae7fba3e18e 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.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/vnet/vnet/lisp-cp/lisp_msg_serdes.c b/vnet/vnet/lisp-cp/lisp_msg_serdes.c
index c1713b36c99..d7b734e9679 100644
--- a/vnet/vnet/lisp-cp/lisp_msg_serdes.c
+++ b/vnet/vnet/lisp-cp/lisp_msg_serdes.c
@@ -114,11 +114,21 @@ lisp_msg_push_ecm (vlib_main_t * vm, vlib_buffer_t *b, int lp, int rp,
gid_address_t *la, gid_address_t *ra)
{
ecm_hdr_t *h;
- ASSERT(gid_address_type(la) == GID_ADDR_IP_PREFIX);
+ ip_address_t _src_ip, * src_ip = &_src_ip, _dst_ip, * dst_ip = &_dst_ip;
+ if (gid_address_type(la) != GID_ADDR_IP_PREFIX)
+ {
+ /* empty ip4 */
+ memset(src_ip, 0, sizeof(src_ip[0]));
+ memset(dst_ip, 0, sizeof(dst_ip[0]));
+ }
+ else
+ {
+ src_ip = &gid_address_ip(la);
+ dst_ip = &gid_address_ip(ra);
+ }
/* Push inner ip and udp */
- pkt_push_udp_and_ip (vm, b, lp, rp, &gid_address_ip(la),
- &gid_address_ip(ra));
+ pkt_push_udp_and_ip (vm, b, lp, rp, src_ip, dst_ip);
/* Push lisp ecm hdr */
h = pkt_push_ecm_hdr (b);