Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH 1/6] netconfig: Use CamelCase for IPv4 address settings
@ 2019-12-10 23:38 Tim Kourt
  2019-12-10 23:38 ` [PATCH 2/6] netconfig: Use CamelCase for IPv4 gateway setting Tim Kourt
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Tim Kourt @ 2019-12-10 23:38 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

---
 src/netconfig.c | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/netconfig.c b/src/netconfig.c
index 9d32c37a..df9d7ce4 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -131,15 +131,24 @@ static struct netconfig_ifaddr *netconfig_ipv4_get_ifaddr(
 	case RTPROT_STATIC:
 
 		ip = l_settings_get_string(netconfig->active_settings, "IPv4",
-									"ip");
-		if (!ip)
-			return NULL;
+								"Address");
+		if (!ip) {
+			ip = l_settings_get_string(netconfig->active_settings,
+							"IPv4", "ip");
+			if (!ip)
+				return NULL;
+		}
 
 		ifaddr = l_new(struct netconfig_ifaddr, 1);
 		ifaddr->ip = ip;
 
 		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)
 			ifaddr->prefix_len = __builtin_popcountl(
 						L_BE32_TO_CPU(in_addr.s_addr));
@@ -150,7 +159,13 @@ static struct netconfig_ifaddr *netconfig_ipv4_get_ifaddr(
 
 		ifaddr->broadcast =
 			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;
 
 		return ifaddr;
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-11  6:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-10 23:38 [PATCH 1/6] netconfig: Use CamelCase for IPv4 address settings Tim Kourt
2019-12-10 23:38 ` [PATCH 2/6] netconfig: Use CamelCase for IPv4 gateway setting Tim Kourt
2019-12-10 23:38 ` [PATCH 3/6] netconfig: Use CamelCase for IPv4 DNS setting Tim Kourt
2019-12-10 23:38 ` [PATCH 4/6] netconfig: Use CamelCase for IPv6 address settings Tim Kourt
2019-12-10 23:38 ` [PATCH 5/6] netconfig: Use CamelCase for IPv6 gateway setting Tim Kourt
2019-12-10 23:38 ` [PATCH 6/6] netconfig: Use CamelCase for IPv6 DNS setting Tim Kourt
2019-12-11  6:52 ` [PATCH 1/6] netconfig: Use CamelCase for IPv4 address settings Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox