summaryrefslogtreecommitdiff
path: root/src/libsystemd-dhcp/dhcp-network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-dhcp/dhcp-network.c')
-rw-r--r--src/libsystemd-dhcp/dhcp-network.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd-dhcp/dhcp-network.c b/src/libsystemd-dhcp/dhcp-network.c
index ce27f425c3..b2de67e8a7 100644
--- a/src/libsystemd-dhcp/dhcp-network.c
+++ b/src/libsystemd-dhcp/dhcp-network.c
@@ -34,6 +34,9 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link)
{
int s;
+ assert(index > 0);
+ assert(link);
+
s = socket(AF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
htons(ETH_P_IP));
if (s < 0)
@@ -77,6 +80,10 @@ int dhcp_network_bind_udp_socket(int index, be32_t client_address)
int dhcp_network_send_raw_socket(int s, const union sockaddr_union *link,
const void *packet, size_t len)
{
+ assert(link);
+ assert(packet);
+ assert(len);
+
if (sendto(s, packet, len, 0, &link->sa, sizeof(link->ll)) < 0)
return -errno;