summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-network.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-06-21 14:39:36 +0200
committerTom Gundersen <teg@jklm.no>2014-06-21 15:02:30 +0200
commitd6bd972d061af306ede2affd2c9340a1660f7996 (patch)
tree49c9db76722dab8dfa2998c5fa46c90ada819f9c /src/libsystemd-network/dhcp-network.c
parentda92ca5eb506d513033e0c7a85daf25a7e1c9d0e (diff)
sd-dhcp-server: fix broadcast of DHCP packets
The destination IP address should be INADDR_BROADCAST, but was accidentally left as INADDR_ANY.
Diffstat (limited to 'src/libsystemd-network/dhcp-network.c')
-rw-r--r--src/libsystemd-network/dhcp-network.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsystemd-network/dhcp-network.c b/src/libsystemd-network/dhcp-network.c
index d7ba0efa12..0e37bea197 100644
--- a/src/libsystemd-network/dhcp-network.c
+++ b/src/libsystemd-network/dhcp-network.c
@@ -127,6 +127,10 @@ int dhcp_network_bind_udp_socket(be32_t address, uint16_t port) {
r = setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
if (r < 0)
return -errno;
+
+ r = setsockopt(s, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
+ if (r < 0)
+ return -errno;
}
r = bind(s, &src.sa, sizeof(src.in));