diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-04-26 09:51:30 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-04-26 13:06:01 +0300 |
commit | 97987e6b3887958df0ce784486c91d0736aeaef7 (patch) | |
tree | 5142bafd35b9d0cd6e5931a5ab3b4775308b2d55 /gdhcp/client.c | |
parent | 4c74c9a816d4592e7004b38fc38fba3973850e84 (diff) | |
download | connman-97987e6b3887958df0ce784486c91d0736aeaef7.tar.gz connman-97987e6b3887958df0ce784486c91d0736aeaef7.tar.bz2 connman-97987e6b3887958df0ce784486c91d0736aeaef7.zip |
gdhcp: Do not change the transaction id if retransmitting
As requested in RFC 3315 chapter 15.1, a client MUST leave
the transaction id unchanged in retransmissions of a message.
Diffstat (limited to 'gdhcp/client.c')
-rw-r--r-- | gdhcp/client.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c index ec1cdeca..71983ce8 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -816,9 +816,15 @@ static int send_dhcpv6_msg(GDHCPClient *dhcp_client, int type, char *msg) init_packet(dhcp_client, packet, type); - dhcp_client->xid = packet->transaction_id[0] << 16 | - packet->transaction_id[1] << 8 | - packet->transaction_id[2]; + if (dhcp_client->retransmit == FALSE) + dhcp_client->xid = packet->transaction_id[0] << 16 | + packet->transaction_id[1] << 8 | + packet->transaction_id[2]; + else { + packet->transaction_id[0] = dhcp_client->xid >> 16; + packet->transaction_id[1] = dhcp_client->xid >> 8 ; + packet->transaction_id[2] = dhcp_client->xid; + } debug(dhcp_client, "sending DHCPv6 %s message xid 0x%04x", msg, dhcp_client->xid); |