From 0c34c78bd545f1f82ab1374b273714b5caba959f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Mon, 6 May 2013 13:06:30 +0300 Subject: 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. --- gdhcp/client.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gdhcp') 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); -- cgit v1.2.3