commit 2d007a25b62ead8e0761ed180491b1e0e813fdb2
parent 1c7e803dbb3383e4cdfae309cb725b76cd1f9e58
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date: Tue, 16 Jul 2019 17:49:46 -0700
netconfig: Differentiate the origin of the addresses.
The origin of the addresses is later used with the route
installations for the convenience of the user.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/netconfig.c b/src/netconfig.c
@@ -49,6 +49,7 @@ struct netconfig {
};
struct netconfig_ifaddr {
+ uint8_t proto;
uint8_t family;
uint8_t prefix_len;
char *ip;
@@ -347,6 +348,7 @@ static void netconfig_dhcp_lease_received(struct netconfig *netconfig,
ifaddr.broadcast = l_dhcp_lease_get_broadcast(lease);
dns = l_dhcp_lease_get_dns(lease);
ifaddr.family = AF_INET;
+ ifaddr.proto = RTPROT_DHCP;
switch (action) {
case LEASE_ACTION_INSTALL:
@@ -465,6 +467,7 @@ static bool netconfig_load_static_addresses(struct netconfig *netconfig,
ifaddr.broadcast = l_settings_get_string(settings, "IPv4", "broadcast");
dns = l_settings_get_string_list(settings, "IPv4", "dns", ' ');
ifaddr.family = AF_INET;
+ ifaddr.proto = RTPROT_STATIC;
netconfig_install_addresses(netconfig, &ifaddr, gateway, dns);