summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-05-06 13:06:30 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-06 14:33:45 +0300
commit0c34c78bd545f1f82ab1374b273714b5caba959f (patch)
tree02fb7c05e6830dfdb5245344bf5885ddd5475f64 /gdhcp
parentae4bb4a283a508b493818d605459090b8ec11c8a (diff)
downloadconnman-0c34c78bd545f1f82ab1374b273714b5caba959f.tar.gz
connman-0c34c78bd545f1f82ab1374b273714b5caba959f.tar.bz2
connman-0c34c78bd545f1f82ab1374b273714b5caba959f.zip
gdhcp: Initialize message status code early
The message status code was initialized too late i.e., after it was set so we lost the status code. This problem was seen with wide-dhcpv6 server.
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/client.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index b671a8ca..305533f0 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1908,6 +1908,8 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition,
pkt = &packet;
+ dhcp_client->status_code = 0;
+
if (dhcp_client->listen_mode == L2)
re = dhcp_recv_l2_packet(&packet,
dhcp_client->listener_sockfd);
@@ -1971,9 +1973,7 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition,
}
}
dhcp_client->status_code = status;
- } else
- dhcp_client->status_code = 0;
-
+ }
} else {
message_type = dhcp_get_option(&packet, DHCP_MESSAGE_TYPE);
if (message_type == NULL)
@@ -2132,7 +2132,6 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition,
switch_listening_mode(dhcp_client, L_NONE);
- dhcp_client->status_code = 0;
get_dhcpv6_request(dhcp_client, packet6, pkt_len,
&dhcp_client->status_code);