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.
This commit is contained in:
Tim Kourt 2019-07-16 17:49:46 -07:00 committed by Denis Kenzior
parent 1c7e803dbb
commit 2d007a25b6
1 changed files with 3 additions and 0 deletions

View File

@ -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);