summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-15 18:55:31 +0200
committerTom Gundersen <teg@jklm.no>2014-07-15 18:55:31 +0200
commitf5de5b00204f041aaec828d336c8afd9e860a5c3 (patch)
treead159454a17556b8f3ac953e8a0428c493f36b4e /src/network
parent30632d97d9d68c8202e562f34afae8f8d6e9c377 (diff)
sd-dhcp-client: make request broadcasts opt-in
It appears there is no good way to decide whether or not broadcasts should be enabled, there is hardware that must have broadcast, and there are networks that only allow unicast. So we give up and make this configurable. By default, unicast is used, but if the kernel were to inform us abotu certain interfaces requiring broadcast, we could change this to opt-in by default in those cases.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c4
-rw-r--r--src/network/networkd-network-gperf.gperf1
-rw-r--r--src/network/networkd.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 877b7a9be2..0fb323b9a5 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1998,6 +1998,10 @@ static int link_configure(Link *link) {
if (r < 0)
return r;
+ r = sd_dhcp_client_set_request_broadcast(link->dhcp_client, link->network->dhcp_broadcast);
+ if (r < 0)
+ return r;
+
if (link->network->dhcp_mtu) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, 26);
if (r < 0)
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 61dd8ef5f6..f5156b43b2 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -51,6 +51,7 @@ DHCP.UseHostname, config_parse_bool, 0,
DHCP.UseDomainName, config_parse_bool, 0, offsetof(Network, dhcp_domainname)
DHCP.UseRoutes, config_parse_bool, 0, offsetof(Network, dhcp_routes)
DHCP.SendHostname, config_parse_bool, 0, offsetof(Network, dhcp_sendhost)
+DHCP.RequestBroadcast, config_parse_bool, 0, offsetof(Network, dhcp_broadcast)
DHCP.CriticalConnection, config_parse_bool, 0, offsetof(Network, dhcp_critical)
DHCP.VendorClassIdentifier, config_parse_string, 0, offsetof(Network, dhcp_vendor_class_identifier)
/* backwards compatibility: do not add new entries to this section */
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 3f0ef5d0ec..9abc0d46ec 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -92,6 +92,7 @@ struct Network {
bool dhcp_hostname;
bool dhcp_domainname;
bool dhcp_sendhost;
+ bool dhcp_broadcast;
bool dhcp_critical;
bool dhcp_routes;
bool ipv4ll;