3333#include "../control/lisp_ms.h"
3434#include "../control/lisp_xtr.h"
3535#include "../data-plane/data-plane.h"
36+ #include "../data-plane/encapsulations/vxlan-gpe.h"
3637#include "../lib/oor_log.h"
3738#include "../lib/shash.h"
3839#include "../lib/util.h"
@@ -421,8 +422,10 @@ configure_tunnel_router(cfg_t *cfg, oor_ctrl_dev_t *dev, lisp_tr_t *tr, shash_t
421422 encap = str_to_lower_case (encap_str );
422423 if (strcmp (encap , "lisp" ) == 0 ) {
423424 tr -> encap_type = ENCP_LISP ;
425+ tr -> encap_port = LISP_DATA_PORT ;
424426 }else if (strcmp (encap , "vxlan-gpe" ) == 0 ){
425427 tr -> encap_type = ENCP_VXLAN_GPE ;
428+ tr -> encap_port = VXLAN_GPE_DATA_PORT ;
426429 }else {
427430 OOR_LOG (LERR , "Unknown encapsulation type: %s" ,encap );
428431 free (encap );
@@ -593,11 +596,6 @@ configure_xtr(cfg_t *cfg)
593596
594597 xtr -> nat_aware = cfg_getbool (cfg , "nat_traversal_support" ) ? TRUE:FALSE;
595598 if (xtr -> nat_aware ){
596- if (nat_set_xTR_ID (xtr ) != GOOD ){
597- OOR_LOG (LERR ,"Could not generate xTR-ID" );
598- return (BAD );
599- }
600- nat_set_site_ID (xtr , 0 );
601599 default_rloc_afi = AF_INET ;
602600 OOR_LOG (LDBG_1 , "NAT support enabled. Set defaul RLOC to IPv4 family" );
603601 }
@@ -619,7 +617,12 @@ configure_xtr(cfg_t *cfg)
619617 return (BAD );
620618 }
621619
622-
620+ /* Generate xTR identifier */
621+ if (tr_set_xTR_ID (xtr ) != GOOD ){
622+ OOR_LOG (LERR ,"Could not generate xTR-ID" );
623+ return (BAD );
624+ }
625+ tr_set_site_ID (xtr , 0 );
623626
624627 /* destroy the hash table */
625628 shash_destroy (lcaf_ht );
@@ -645,11 +648,6 @@ configure_mn(cfg_t *cfg)
645648
646649 xtr -> nat_aware = cfg_getbool (cfg , "nat_traversal_support" ) ? TRUE:FALSE;
647650 if (xtr -> nat_aware ){
648- if (nat_set_xTR_ID (xtr ) != GOOD ){
649- OOR_LOG (LERR ,"Could not generate xTR-ID" );
650- return (BAD );
651- }
652- nat_set_site_ID (xtr , 0 );
653651 default_rloc_afi = AF_INET ;
654652 OOR_LOG (LDBG_1 , "NAT support enabled. Set defaul RLOC to IPv4 family" );
655653 }
@@ -671,6 +669,13 @@ configure_mn(cfg_t *cfg)
671669 return (BAD );
672670 }
673671
672+ /* Generate xTR identifier */
673+ if (tr_set_xTR_ID (xtr ) != GOOD ){
674+ OOR_LOG (LERR ,"Could not generate xTR-ID" );
675+ return (BAD );
676+ }
677+ tr_set_site_ID (xtr , 0 );
678+
674679 /* destroy the hash table */
675680 shash_destroy (lcaf_ht );
676681
0 commit comments