BIND 10 trac1186, updated. 8e40197a5c18cddcd973fcf055c4a2ff3c1dff89 [1186] trans-id unpacking fix.
BIND 10 source code commits
bind10-changes at lists.isc.org
Sat Aug 27 11:33:12 UTC 2011
The branch, trac1186 has been updated
via 8e40197a5c18cddcd973fcf055c4a2ff3c1dff89 (commit)
from 41b93cc8349dafed84d3f08246de47f83b9d1f13 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8e40197a5c18cddcd973fcf055c4a2ff3c1dff89
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Sat Aug 27 13:32:10 2011 +0200
[1186] trans-id unpacking fix.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/pkt6.cc | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/pkt6.cc b/src/lib/dhcp/pkt6.cc
index 9ec275c..3ac4665 100644
--- a/src/lib/dhcp/pkt6.cc
+++ b/src/lib/dhcp/pkt6.cc
@@ -135,17 +135,11 @@ Pkt6::packUDP() {
// DHCPv6 header: message-type (1 octect) + transaction id (3 octets)
data_[0] = msg_type_;
- // that's elegant, but it doesn't work
+ // store 3-octet transaction-id
data_[1] = (transid_ >> 16) & 0xff;
data_[2] = (transid_ >> 8) & 0xff;
data_[3] = (transid_) & 0xff;
- // that's ugly, but it does work
- int tmp = transid_;
- data_[3] = tmp%256; tmp /=256;
- data_[2] = tmp%256; tmp /=256;
- data_[1] = tmp%256; tmp /=256;
-
// the rest are options
unsigned short offset = LibDHCP::packOptions6(data_, length,
4/*offset*/,
@@ -214,7 +208,8 @@ Pkt6::unpackUDP() {
return (false);
}
msg_type_ = data_[0];
- transid_ = ((unsigned int)data_[1] << 16) + ((unsigned int)data_[2] << 8) + (unsigned int)data_[3];
+ transid_ = ( ((unsigned char)data_[1]) << 16 ) +
+ (((unsigned char)data_[2]) << 8) + ((unsigned char)data_[3]);
transid_ = transid_ & 0xffffff;
unsigned int offset = LibDHCP::unpackOptions6(data_,
More information about the bind10-changes
mailing list