summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-11 18:02:54 +0200
committerTom Gundersen <teg@jklm.no>2014-04-11 18:02:54 +0200
commiteb105b96d58a3ebfeedb76a5d421b13748e0395c (patch)
treefd01e3d05e43adeaba29f71ea1d04b850e330fb6 /src
parent4d978a46693e4f23bc73da6a0bafacfcff2aba05 (diff)
sd-dhcp-client: rebind raw socket when resetting transaction id
As we are now filtering the raw socket based on the transaction id, we must reset the BPF when we reset the transaction id.
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index afad776d1c..4be37a2389 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -473,7 +473,13 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec,
/* start over as we did not receive a timely ack or nak */
client->state = DHCP_STATE_INIT;
client->attempt = 1;
+
+ client->fd = safe_close(client->fd);
client->xid = random_u32();
+ r = dhcp_network_bind_raw_socket(client->index, &client->link, client->xid);
+ if (r < 0)
+ goto error;
+ client->fd = r;
/* fall through */
case DHCP_STATE_INIT: