summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorClemens Gruber <clemensgru@gmail.com>2016-05-18 01:34:25 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-05-17 19:34:25 -0400
commit77ff6022fa30005f8e965c42064e0274d329b6c0 (patch)
tree1b25e5b698960e1699958c329f7685d428b75eda /src/network/networkd-link.c
parenta363a2e45f67eea5cc0a8fbbfc4a514f1b015cf7 (diff)
networkd: Add EmitRouter= option for DHCP Server (#3251)
Add an option to disable appending DHCP option 3 (Router) to the DHCP OFFER and ACK packets. This commit adds the boolean option EmitRouter= for the [DHCPServer] section in .network files. Rationale: On embedded devices, it is very useful to have a DHCP server running on an USB OTG ethernet gadget interface to avoid manual setup on the client PCs, but it should only serve IP addresses, no route(r)s. Otherwise, Windows clients experience network connectivity issues, due to them using the address set in DHCP option 3 as default gateway. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index f3a79b0ec8..16a3609a0b 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1020,6 +1020,12 @@ static int link_enter_set_addresses(Link *link) {
log_link_warning_errno(link, r, "Failed to set NTP server for DHCP server, ignoring: %m");
}
+ r = sd_dhcp_server_set_emit_router(link->dhcp_server, link->network->dhcp_server_emit_router);
+ if (r < 0) {
+ log_link_warning_errno(link, r, "Failed to set router emission for DHCP server: %m");
+ return r;
+ }
+
if (link->network->dhcp_server_emit_timezone) {
_cleanup_free_ char *buffer = NULL;
const char *tz = NULL;