Refactor tun_if.h
Use a common function for generating interface name. Use full interface name in tun_if.h functions.
This commit is contained in:
@@ -777,7 +777,9 @@ rrc_ue_establish_drb(
|
||||
"10.0.%d.%d",
|
||||
UE_NAS_USE_TUN ? 1 : (ip_addr_offset3 + ue_mod_idP + 1),
|
||||
ip_addr_offset4 + ue_mod_idP + 1);
|
||||
oip_ifup = tun_config(ip_addr_offset3 + ue_mod_idP + 1, ip, NULL, "oaitun_ue");
|
||||
char ifname[IFNAMSIZ];
|
||||
tun_generate_ifname(ifname, "oaitun_ue", ip_addr_offset3 + ue_mod_idP);
|
||||
oip_ifup = tun_config(ifname, ip, NULL);
|
||||
|
||||
if (oip_ifup == 0 && (!UE_NAS_USE_TUN)) { // interface is up --> send a config the DRB
|
||||
LOG_I(OIP,"[UE %d] Config the ue net interface %d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
|
||||
@@ -5250,7 +5250,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
ctxt_pP->module_id);
|
||||
char ip[20];
|
||||
snprintf(ip, sizeof(ip), "10.0.%d.%d", ctxt_pP->module_id + 1, ctxt_pP->module_id + 1);
|
||||
oip_ifup = tun_config(ctxt_pP->module_id, ip, NULL, "oaitun_oai");
|
||||
char ifname[IFNAMSIZ];
|
||||
tun_generate_ifname(ifname, "oaitun_oai", ctxt_pP->module_id);
|
||||
oip_ifup = tun_config(ifname, ip, NULL);
|
||||
|
||||
if (oip_ifup == 0) { // interface is up --> send a config the DRB
|
||||
module_id_t ue_module_id;
|
||||
|
||||
Reference in New Issue
Block a user