summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-08-14 20:35:37 +0200
committerTom Gundersen <teg@jklm.no>2014-08-14 23:13:14 +0200
commit9b4d1882ca46d5b2ae7d028ec2b5d0d0c3a46a76 (patch)
treed2865779b227a0ca337ed7c23395c2c4cbdab2db /src/network/networkd-link.c
parent9d685ca8193c0da3ad5746be3871f5350179a3b3 (diff)
sd-network: add sd_network_linkg_get_domains()
For now this only exposes the domain name (DHCP Option 15), and not the search string (DHCP Option 119), which will be implemented in a follow-up patch.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 160f507dc9..6497090bc0 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1763,6 +1763,15 @@ int link_save(Link *link) {
fputs("\n", f);
+ if (link->network->dhcp_domainname &&
+ link->dhcp_lease) {
+ const char *domainname;
+
+ r = sd_dhcp_lease_get_domainname(link->dhcp_lease, &domainname);
+ if (r >= 0)
+ fprintf(f, "DOMAINS=%s\n", domainname);
+ }
+
fprintf(f, "LLMNR=%s\n",
llmnr_support_to_string(link->network->llmnr));
}