chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libsystemd-dhcp: Fix receiving of other message when expecting Ack
[elogind.git]
/
src
/
libsystemd-dhcp
/
dhcp-client.c
diff --git
a/src/libsystemd-dhcp/dhcp-client.c
b/src/libsystemd-dhcp/dhcp-client.c
index 18a6e3c50d725cb93ed06df60cd708267284e9c1..7dc154612816ac3902070cce9bbecdba76efe5f4 100644
(file)
--- a/
src/libsystemd-dhcp/dhcp-client.c
+++ b/
src/libsystemd-dhcp/dhcp-client.c
@@
-731,8
+731,15
@@
static int client_receive_ack(sd_dhcp_client *client, DHCPPacket *offer,
len = len - DHCP_IP_UDP_SIZE;
r = dhcp_option_parse(&offer->dhcp, len, client_parse_offer, lease);
len = len - DHCP_IP_UDP_SIZE;
r = dhcp_option_parse(&offer->dhcp, len, client_parse_offer, lease);
- if (r != DHCP_ACK)
+ if (r == DHCP_NAK) {
+ r = DHCP_EVENT_NO_LEASE;
goto error;
goto error;
+ }
+
+ if (r != DHCP_ACK) {
+ r = -ENOMSG;
+ goto error;
+ }
lease->address = offer->dhcp.yiaddr;
lease->address = offer->dhcp.yiaddr;