Replace nas_config_mbms_s1() call with nas_config_mbms()
Comparing both functions, it seems that nas_config_mbms_s1() sets the same parameters, assuming that in nas_config_mbms(), we set - (UE_NAS_USE_TUN || ENB_NAS_USE_TUN) yielding true -> should yield the same interface name - netmask is hardcoded to 255.255.255.0 - baseNetAddress is hardcoded 10.0 So replace the call with nas_config_mbms() by setting parameters accordingly.
This commit is contained in:
@@ -2317,7 +2317,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask, int id) {
|
||||
LOG_I(PDCP, "ENB pdcp will use tun interface\n");
|
||||
} else if (pdcp_optmask & ENB_NAS_USE_TUN_W_MBMS_BIT) {
|
||||
netlink_init_mbms_tun("enm", 0);
|
||||
nas_config_mbms_s1(1, 2, 1, "enm");
|
||||
nas_config_mbms(1, 2, 1, "enm");
|
||||
LOG_I(PDCP, "ENB pdcp will use mbms tun interface\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -188,48 +188,6 @@ int nas_config_mbms(int interface_id, int thirdOctet, int fourthOctet, char *ifn
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
int nas_config_mbms_s1(int interface_id, int thirdOctet, int fourthOctet, char *ifname) {
|
||||
//char buf[5];
|
||||
char ipAddress[20];
|
||||
char broadcastAddress[20];
|
||||
char interfaceName[20];
|
||||
int returnValue;
|
||||
//if(strcmp(ifname,"ue") == 0)
|
||||
//sprintf(ipAddress, "%s.%d.%d", "20.0",thirdOctet,fourthOctet);
|
||||
////else
|
||||
sprintf(ipAddress, "%s.%d.%d","10.0",thirdOctet,fourthOctet);
|
||||
|
||||
sprintf(broadcastAddress, "%s.%d.255","10.0", thirdOctet);
|
||||
sprintf(interfaceName, "%s%s%d", "oaitun_",ifname,interface_id);
|
||||
bringInterfaceUp(interfaceName, 0);
|
||||
// sets the machine address
|
||||
returnValue= setInterfaceParameter(interfaceName, ipAddress,SIOCSIFADDR);
|
||||
|
||||
// sets the machine network mask
|
||||
if(!returnValue)
|
||||
returnValue= setInterfaceParameter(interfaceName, "255.255.255.0",SIOCSIFNETMASK);
|
||||
printf("returnValue %d\n",returnValue);
|
||||
|
||||
// sets the machine broadcast address
|
||||
if(!returnValue)
|
||||
returnValue= setInterfaceParameter(interfaceName, broadcastAddress,SIOCSIFBRDADDR);
|
||||
printf("returnValue %d\n",returnValue);
|
||||
|
||||
if(!returnValue)
|
||||
bringInterfaceUp(interfaceName, 1);
|
||||
printf("returnValue %d\n",returnValue);
|
||||
|
||||
if(!returnValue)
|
||||
LOG_I(OIP,"Interface %s successfully configured, ip address %s, mask %s broadcast address %s\n",
|
||||
interfaceName, ipAddress, "255.255.255.0", broadcastAddress);
|
||||
else
|
||||
LOG_E(OIP,"Interface %s couldn't be configured (ip address %s, mask %s broadcast address %s)\n",
|
||||
interfaceName, ipAddress, "255.255.255.0", broadcastAddress);
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
// non blocking full configuration of the interface (address, and the two lest octets of the address)
|
||||
int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifname) {
|
||||
//char buf[5];
|
||||
|
||||
@@ -64,19 +64,6 @@ int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifsuffix
|
||||
*/
|
||||
int nas_config_mbms(int interface_id, int thirdOctet, int fourthOctet, char *ifsuffix);
|
||||
|
||||
/*! \fn int nas_config_mbms_s1(char*, int, int)
|
||||
* \brief This function initializes the nasmesh interface using the basic values,
|
||||
* basic address, network mask and broadcast address, as the default configured
|
||||
* ones
|
||||
* \param[in] interfaceName, the name of the interface, e.g. nasmesh0 or nasmesh1
|
||||
* \param[in] third octet of the ip address e.g. for the 10.1.2.3 address would be 2
|
||||
* \param[in] fourth octet of the ip address e.g. for the 10.1.2.3 address would be 3
|
||||
* \return 0 on success, otherwise 1, if couldn't open a socket and 2 if the ioctl fails
|
||||
* \note
|
||||
* @ingroup _nas
|
||||
*/
|
||||
int nas_config_mbms_s1(int interface_id, int thirdOctet, int fourthOctet, char *ifsuffix);
|
||||
|
||||
/*! \fn void setBaseNetAddress(char*)
|
||||
* \brief This function sets the basic network address used
|
||||
* \param[in] baseAddr, the new basic address e.g.for 10.0.1.2, would be 10.0
|
||||
|
||||
Reference in New Issue
Block a user