summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-04-26 06:51:30 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-26 10:06:01 (GMT)
commit97987e6b3887958df0ce784486c91d0736aeaef7 (patch)
tree5142bafd35b9d0cd6e5931a5ab3b4775308b2d55 /gdhcp
parent4c74c9a816d4592e7004b38fc38fba3973850e84 (diff)
downloadconnman-97987e6b3887958df0ce784486c91d0736aeaef7.zip
connman-97987e6b3887958df0ce784486c91d0736aeaef7.tar.gz
connman-97987e6b3887958df0ce784486c91d0736aeaef7.tar.bz2
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')
-rw-r--r--gdhcp/client.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index ec1cdec..71983ce 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);