From 085cabf266bfbbc5ebdada9179a8ebe404e540a8 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 6 May 2014 21:57:09 +0200 Subject: [PATCH] dhcp-network: don't pass ifindex to bind_udp_socket UDP sockets can anyway not be bound to specific netdev's. The packages would have to be filtered when received instead. --- src/libsystemd-network/dhcp-internal.h | 2 +- src/libsystemd-network/dhcp-network.c | 2 +- src/libsystemd-network/sd-dhcp-client.c | 3 +-- src/libsystemd-network/test-dhcp-client.c | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libsystemd-network/dhcp-internal.h b/src/libsystemd-network/dhcp-internal.h index c0cfa83471e..eb4a6cdce28 100644 --- a/src/libsystemd-network/dhcp-internal.h +++ b/src/libsystemd-network/dhcp-internal.h @@ -30,7 +30,7 @@ #include "dhcp-protocol.h" int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link, uint32_t xid); -int dhcp_network_bind_udp_socket(int index, be32_t address, uint16_t port); +int dhcp_network_bind_udp_socket(be32_t address, uint16_t port); int dhcp_network_send_raw_socket(int s, const union sockaddr_union *link, const void *packet, size_t len); int dhcp_network_send_udp_socket(int s, be32_t address, uint16_t port, diff --git a/src/libsystemd-network/dhcp-network.c b/src/libsystemd-network/dhcp-network.c index 902c9d9be2c..722f1b18b3a 100644 --- a/src/libsystemd-network/dhcp-network.c +++ b/src/libsystemd-network/dhcp-network.c @@ -96,7 +96,7 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link, uint32_t return s; } -int dhcp_network_bind_udp_socket(int index, be32_t address, uint16_t port) +int dhcp_network_bind_udp_socket(be32_t address, uint16_t port) { int s; union sockaddr_union src = { diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 2ddb9ad1dca..ab9f68d5286 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -770,8 +770,7 @@ static int client_timeout_t1(sd_event_source *s, uint64_t usec, client->state = DHCP_STATE_RENEWING; client->attempt = 1; - r = dhcp_network_bind_udp_socket(client->index, - client->lease->address, + r = dhcp_network_bind_udp_socket(client->lease->address, DHCP_PORT_CLIENT); if (r < 0) { client_stop(client, r); diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index 83dd6194076..599bda1a5ee 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -204,7 +204,7 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link, uint32_t return test_fd[0]; } -int dhcp_network_bind_udp_socket(int index, be32_t address, uint16_t port) +int dhcp_network_bind_udp_socket(be32_t address, uint16_t port) { return 0; }