Skip to content

Commit b534338

Browse files
committed
Merge remote-tracking branch 'origin/testing'
2 parents 8d9f6c2 + e74e35d commit b534338

13 files changed

Lines changed: 79 additions & 41 deletions

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
google()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.1.1'
10+
classpath 'com.android.tools.build:gradle:3.1.2'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files

oor/config/oor_config_confuse.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
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

oor/config/oor_config_functions.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ process_mapping_config(oor_ctrl_dev_t * dev, shash_t * lcaf_ht,
10051005
conf_mapping->iid = 0;
10061006
}
10071007
if (conf_mapping->iid > 0){
1008-
iidmlen = (lisp_addr_ip_afi(ip_eid_prefix) == AF_INET) ? 32: 128;
1008+
iidmlen = 32;
10091009
eid_prefix = lisp_addr_new_init_iid(conf_mapping->iid, ip_eid_prefix, iidmlen);
10101010
}else{
10111011
eid_prefix = lisp_addr_clone(ip_eid_prefix);
@@ -1302,12 +1302,12 @@ rtr_add_rtr_ms_node(lisp_rtr_t *rtr, char *addr_str, char *key, char *draft_vers
13021302
}
13031303

13041304
void
1305-
nat_set_site_ID(lisp_xtr_t *xtr, uint64_t site_id)
1305+
tr_set_site_ID(lisp_xtr_t *xtr, uint64_t site_id)
13061306
{
13071307
xtr->site_id = site_id;
13081308
}
13091309
int
1310-
nat_set_xTR_ID(lisp_xtr_t *xtr)
1310+
tr_set_xTR_ID(lisp_xtr_t *xtr)
13111311
{
13121312
FILE *xtr_id_file;
13131313
lisp_xtr_id *xtr_id = &(xtr->xtr_id);
@@ -1357,7 +1357,7 @@ nat_set_xTR_ID(lisp_xtr_t *xtr)
13571357
}
13581358
fclose(xtr_id_file);
13591359

1360-
OOR_LOG(LDBG_2,"nat_set_xTR_ID: xTR_ID initialiazed with value: %s",
1360+
OOR_LOG(LDBG_2,"tr_set_xTR_ID: xTR_ID initialiazed with value: %s",
13611361
get_char_from_xTR_ID(xtr_id));
13621362

13631363
return(GOOD);

oor/config/oor_config_functions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ rtr_add_rtr_ms_node(lisp_rtr_t *rtr, char *addr_str, char *key, char *draft_vers
201201
int
202202
ms_add_rtr_node(lisp_ms_t *ms, char *name, char *addr_str, char *key);
203203

204-
void nat_set_site_ID(lisp_xtr_t *xtr, uint64_t site_id);
205-
int nat_set_xTR_ID(lisp_xtr_t *xtr);
204+
void tr_set_site_ID(lisp_xtr_t *xtr, uint64_t site_id);
205+
int tr_set_xTR_ID(lisp_xtr_t *xtr);
206206

207207

208208

oor/config/oor_config_uci.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ configure_xtr(struct uci_context *ctx, struct uci_package *pck)
283283

284284
if (nat_aware == TRUE){
285285
xtr->nat_aware = TRUE;
286-
nat_set_xTR_ID(xtr);
287-
nat_set_site_ID(xtr, 0);
288286
default_rloc_afi = AF_INET;
289287
OOR_LOG(LDBG_1, "NAT support enabled. Set defaul RLOC to IPv4 family");
290288
}else{
@@ -541,6 +539,13 @@ configure_xtr(struct uci_context *ctx, struct uci_package *pck)
541539
}
542540
}
543541

542+
/* Generate xTR identifier */
543+
if (tr_set_xTR_ID(xtr) != GOOD){
544+
OOR_LOG(LERR,"Could not generate xTR-ID");
545+
return (BAD);
546+
}
547+
tr_set_site_ID(xtr, 0);
548+
544549
/* Calculate forwarding info por proxy-etrs */
545550
if (xtr->tr.fwd_policy->init_map_cache_policy_inf(xtr->tr.fwd_policy_dev_parm,ipv4_petrs_mc) != GOOD){
546551
OOR_LOG(LDBG_1, "Couldn't initiate routing info for PeTRs for IPv4 EIDs!.");
@@ -644,8 +649,6 @@ configure_mn(struct uci_context *ctx, struct uci_package *pck)
644649

645650
if (nat_aware == TRUE){
646651
xtr->nat_aware = TRUE;
647-
nat_set_xTR_ID(xtr);
648-
nat_set_site_ID(xtr, 0);
649652
default_rloc_afi = AF_INET;
650653
OOR_LOG(LDBG_1, "NAT support enabled. Set defaul RLOC to IPv4 family");
651654
}else{
@@ -901,6 +904,13 @@ configure_mn(struct uci_context *ctx, struct uci_package *pck)
901904
}
902905
}
903906

907+
/* Generate xTR identifier */
908+
if (tr_set_xTR_ID(xtr) != GOOD){
909+
OOR_LOG(LERR,"Could not generate xTR-ID");
910+
return (BAD);
911+
}
912+
tr_set_site_ID(xtr, 0);
913+
904914
/* Calculate forwarding info por proxy-etrs */
905915
if (xtr->tr.fwd_policy->init_map_cache_policy_inf(xtr->tr.fwd_policy_dev_parm,ipv4_petrs_mc) != GOOD){
906916
OOR_LOG(LDBG_1, "Couldn't initiate routing info for PeTRs for IPv4 EIDs!.");

oor/control/lisp_rtr.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "../lib/sockets.h"
2929
#include "../lib/timers_utils.h"
3030
#include "../lib/util.h"
31+
#include "../data-plane/encapsulations/vxlan-gpe.h"
3132
#include "lisp_rtr.h"
3233

3334
/************************* Structure definitions *****************************/
@@ -431,7 +432,7 @@ rtr_get_forwarding_entry(oor_ctrl_dev_t *dev, packet_tuple_t *tuple)
431432
map_loc_e = rtr->all_locs_map;
432433

433434
if (tuple->iid > 0){
434-
iidmlen = (lisp_addr_ip_afi(&tuple->src_addr) == AF_INET) ? 32: 128;
435+
iidmlen = 32;
435436
src_eid = lisp_addr_new_init_iid(tuple->iid, &tuple->src_addr, iidmlen);
436437
dst_eid = lisp_addr_new_init_iid(tuple->iid, &tuple->dst_addr, iidmlen);
437438
}else{
@@ -698,7 +699,7 @@ rtr_recv_map_notify(lisp_rtr_t *rtr, lbuf_t *buf, void *ecm_hdr, uconn_t *int_uc
698699
nonces_lst = htable_nonces_lookup(nonces_ht, MNTF_NONCE(hdr));
699700
if (!nonces_lst){
700701
OOR_LOG(LDBG_1, "No Map Register resent with nonce: %"PRIx64
701-
" Discarding message!", MNTF_NONCE(hdr));
702+
" Discarding message!", htonll(MNTF_NONCE(hdr)));
702703
return(BAD);
703704
}
704705
timer = nonces_list_timer(nonces_lst);
@@ -830,11 +831,21 @@ rtr_recv_map_notify(lisp_rtr_t *rtr, lbuf_t *buf, void *ecm_hdr, uconn_t *int_uc
830831

831832

832833

833-
/* Resend Map Notify as a data Map Notify -> Encapsualate message in a data packet */
834+
/* Resend Map Notify as a data Map Notify -> Encapsulate message in a data packet */
834835
iid = MAX_IID;
835836
lbuf_point_to_l3(&b);
836837

837-
lisp_data_push_hdr(&b, iid);
838+
switch (rtr->tr.encap_type) {
839+
case ENCP_LISP:
840+
lisp_data_push_hdr(&b, iid);
841+
break;
842+
case ENCP_VXLAN_GPE:
843+
vxlan_gpe_data_push_hdr(&b, iid, vxlan_gpe_get_next_prot(loct_conn_inf->pub_xtr_addr));
844+
break;
845+
default:
846+
OOR_LOG(LERR, "Unknown encapsulation type, cannot re-encapsulate Data-Map-Notify");
847+
return (BAD);
848+
}
838849
uconn_init(&fwd_uc, LISP_CONTROL_PORT, loct_conn_inf->pub_xtr_port, loct_conn_inf->rtr_addr,loct_conn_inf->pub_xtr_addr);
839850
res = send_msg(&rtr->super, &b, &fwd_uc);
840851

oor/control/lisp_tr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ tr_recv_map_reply(lisp_tr_t *tr, lbuf_t *buf, uconn_t *udp_con)
110110
nonces_lst = htable_nonces_lookup(nonces_ht, MREP_NONCE(mrep_hdr));
111111
if (!nonces_lst){
112112
OOR_LOG(LDBG_2, " Nonce %"PRIx64" doesn't match any Map-Request nonce. "
113-
"Discarding message!", MREP_NONCE(mrep_hdr));
113+
"Discarding message!", htonll(MREP_NONCE(mrep_hdr)));
114114
return(BAD);
115115
}
116116
timer = nonces_list_timer(nonces_lst);

oor/control/lisp_tr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ typedef struct lisp_tr {
5050
shash_t *iface_locators_table; /* Key: Iface name, Value: iface_locators */
5151

5252
oor_encap_t encap_type;
53+
uint16_t encap_port;
5354

5455
} lisp_tr_t;
5556

oor/control/lisp_xtr.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ xtr_get_forwarding_entry(oor_ctrl_dev_t *dev, packet_tuple_t *tuple)
648648

649649

650650
if (tuple->iid > 0){
651-
iidmlen = (lisp_addr_ip_afi(&tuple->src_addr) == AF_INET) ? 32: 128;
651+
iidmlen = 32;
652652
src_eid = lisp_addr_new_init_iid(tuple->iid, &tuple->src_addr, iidmlen);
653653
dst_eid = lisp_addr_new_init_iid(tuple->iid, &tuple->dst_addr, iidmlen);
654654
}else{
@@ -863,7 +863,7 @@ xtr_recv_map_notify(lisp_xtr_t *xtr, lbuf_t *buf)
863863
nonces_lst = htable_nonces_lookup(nonces_ht, MNTF_NONCE(hdr));
864864
if (!nonces_lst){
865865
OOR_LOG(LDBG_1, "No Map Register sent with nonce: %"PRIx64
866-
" Discarding message!", MNTF_NONCE(hdr));
866+
" Discarding message!", htonll(MNTF_NONCE(hdr)));
867867
return(BAD);
868868
}
869869
timer = nonces_list_timer(nonces_lst);
@@ -948,7 +948,7 @@ xtr_recv_info_nat(lisp_xtr_t *xtr, lbuf_t *buf, uconn_t *uc)
948948
nonces_lst = htable_nonces_lookup(nonces_ht, INF_REQ_NONCE(info_nat_hdr));
949949
if (!nonces_lst){
950950
OOR_LOG(LDBG_2, " Nonce %"PRIx64" doesn't match any Info-Request nonce. "
951-
"Discarding message!", INF_REQ_NONCE(info_nat_hdr));
951+
"Discarding message!", htonll(INF_REQ_NONCE(info_nat_hdr)));
952952
return(BAD);
953953
}
954954

@@ -1057,6 +1057,7 @@ xtr_build_and_send_map_reg(lisp_xtr_t * xtr, mapping_t * m, map_server_elt *ms,
10571057
}
10581058

10591059
hdr = lisp_msg_hdr(b);
1060+
10601061
MREG_PROXY_REPLY(hdr) = ms->proxy_reply;
10611062
MREG_NONCE(hdr) = nonce;
10621063

@@ -1120,7 +1121,7 @@ xtr_build_and_send_encap_map_reg(lisp_xtr_t * xtr, mapping_t * m, map_server_elt
11201121

11211122

11221123

1123-
uconn_init(&uc, LISP_DATA_PORT, LISP_CONTROL_PORT, etr_addr, rtr_addr);
1124+
uconn_init(&uc, xtr->tr.encap_port, LISP_CONTROL_PORT, etr_addr, rtr_addr);
11241125
send_msg(&xtr->super, b, &uc);
11251126

11261127
lisp_msg_destroy(b);

oor/lib/lisp_site.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ lisp_site_prefix_init(lisp_addr_t *eid, uint32_t iid, int key_type, char *key,
3131

3232
sp = xzalloc(sizeof(lisp_site_prefix_t));
3333
if (iid > 0){
34-
iidmlen = (lisp_addr_ip_afi(eid) == AF_INET) ? 32: 128;
34+
iidmlen = 32;
3535
sp->eid_prefix = lisp_addr_new_init_iid(iid, eid, iidmlen);
3636
}else{
3737
sp->eid_prefix = lisp_addr_clone(eid);

0 commit comments

Comments
 (0)