mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-09 23:34:41 +01:00
cwmp - UCI 'cwmp.cpe.interface' was not documented.
This commit is contained in:
parent
e99dc20279
commit
55126b00e4
1 changed files with 3 additions and 8 deletions
|
|
@ -455,19 +455,14 @@ static int network_get_ipaddr(char *iface, int ipver, char **value)
|
|||
|
||||
static void get_management_ip_port(char **listen_addr)
|
||||
{
|
||||
char *ip = NULL, *port = NULL, *interface = NULL, *if_name = NULL, *version = NULL;
|
||||
char *ip = NULL, *port = NULL, *interface = NULL, *version = NULL;
|
||||
|
||||
dmuci_get_option_value_string_varstate("cwmp", "cpe", "interface", &if_name);
|
||||
dmuci_get_option_value_string_varstate("cwmp", "acs", "ip_version", &version);
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "port", &port);
|
||||
dmuci_get_option_value_string("cwmp", "cpe", *version == '6' ? "default_wan6_interface" : "default_wan_interface", &interface);
|
||||
|
||||
if (network_get_ipaddr(interface, *version == '6' ? 6 : 4, &ip) == -1) {
|
||||
if (if_name[0] == '\0')
|
||||
return;
|
||||
|
||||
ip = (*version == '6') ? get_ipv6(if_name) : ioctl_get_ipv4(if_name);
|
||||
}
|
||||
if (network_get_ipaddr(interface, *version == '6' ? 6 : 4, &ip) == -1)
|
||||
return;
|
||||
|
||||
if (ip[0] != '\0' && port[0] != '\0') {
|
||||
dmasprintf(listen_addr, (*version == '6') ? "[%s]:%s" : "%s:%s", ip, port);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue