3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

netconfig: Use CamelCase for IPv4 address settings

This commit is contained in:
Tim Kourt 2019-12-10 15:38:32 -08:00 committed by Denis Kenzior
parent 1b483c3963
commit 0d9487d4ec

View File

@ -131,15 +131,24 @@ static struct netconfig_ifaddr *netconfig_ipv4_get_ifaddr(
case RTPROT_STATIC: case RTPROT_STATIC:
ip = l_settings_get_string(netconfig->active_settings, "IPv4", ip = l_settings_get_string(netconfig->active_settings, "IPv4",
"ip"); "Address");
if (!ip) if (!ip) {
return NULL; ip = l_settings_get_string(netconfig->active_settings,
"IPv4", "ip");
if (!ip)
return NULL;
}
ifaddr = l_new(struct netconfig_ifaddr, 1); ifaddr = l_new(struct netconfig_ifaddr, 1);
ifaddr->ip = ip; ifaddr->ip = ip;
netmask = l_settings_get_string(netconfig->active_settings, netmask = l_settings_get_string(netconfig->active_settings,
"IPv4", "netmask"); "IPv4", "Netmask");
if (!netmask)
netmask = l_settings_get_string(
netconfig->active_settings,
"IPv4", "netmask");
if (netmask && inet_pton(AF_INET, netmask, &in_addr) > 0) if (netmask && inet_pton(AF_INET, netmask, &in_addr) > 0)
ifaddr->prefix_len = __builtin_popcountl( ifaddr->prefix_len = __builtin_popcountl(
L_BE32_TO_CPU(in_addr.s_addr)); L_BE32_TO_CPU(in_addr.s_addr));
@ -150,7 +159,13 @@ static struct netconfig_ifaddr *netconfig_ipv4_get_ifaddr(
ifaddr->broadcast = ifaddr->broadcast =
l_settings_get_string(netconfig->active_settings, l_settings_get_string(netconfig->active_settings,
"IPv4", "broadcast"); "IPv4", "Broadcast");
if (!ifaddr->broadcast)
ifaddr->broadcast =
l_settings_get_string(
netconfig->active_settings,
"IPv4", "broadcast");
ifaddr->family = AF_INET; ifaddr->family = AF_INET;
return ifaddr; return ifaddr;