BIND 10 trac2892, updated. f6f61132111a50cc693059ec5575291cb7f13d98 [2892] Replaced tabs with spaces and wrapped long line. Also fixed a typo.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 16 15:43:47 UTC 2014
The branch, trac2892 has been updated
via f6f61132111a50cc693059ec5575291cb7f13d98 (commit)
from 3a21271bd5b69fd828de3dd3691cc3628c54ae45 (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 f6f61132111a50cc693059ec5575291cb7f13d98
Author: Marcin Siodelski <marcin at isc.org>
Date: Thu Jan 16 16:43:33 2014 +0100
[2892] Replaced tabs with spaces and wrapped long line. Also fixed a typo.
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp6/dhcp6_srv.cc | 51 +++++++++++++++--------------
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc | 4 +--
2 files changed, 28 insertions(+), 27 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc
index 0d0daf9..251be41 100644
--- a/src/bin/dhcp6/dhcp6_srv.cc
+++ b/src/bin/dhcp6/dhcp6_srv.cc
@@ -207,29 +207,30 @@ void Dhcpv6Srv::sendPacket(const Pkt6Ptr& packet) {
bool
Dhcpv6Srv::testServerID(const Pkt6Ptr& pkt){
- /// @todo Currently we always check server identifier regardless if
- /// it is allowed in the received message or not (per RFC3315).
- /// If the server identifier is not allowed in the message, the
- /// sanityCheck function should deal with it. We may rethink this
- /// design if we decide that it is appropriate to check at this stage
- /// of message processing that the server identifier must or must not
- /// be present. In such case however, the logic checking server id
- /// will have to be removed from sanityCheck and placed here instead,
- /// to avoid duplicate checks.
- OptionPtr server_id = pkt->getOption(D6O_SERVERID);
- if (server_id){
- // Let us test received ServerID if it is same as ServerID
- // which is beeing used by server
- if (getServerID()->getData() != server_id->getData()){
- LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_PACKET_MISMATCH_SERVERID_DROP)
- .arg(pkt->getName())
- .arg(pkt->getTransid())
- .arg(pkt->getIface());
- return (false);
- }
- }
- // retun True if: no serverid received or ServerIDs matching
- return (true);
+ /// @todo Currently we always check server identifier regardless if
+ /// it is allowed in the received message or not (per RFC3315).
+ /// If the server identifier is not allowed in the message, the
+ /// sanityCheck function should deal with it. We may rethink this
+ /// design if we decide that it is appropriate to check at this stage
+ /// of message processing that the server identifier must or must not
+ /// be present. In such case however, the logic checking server id
+ /// will have to be removed from sanityCheck and placed here instead,
+ /// to avoid duplicate checks.
+ OptionPtr server_id = pkt->getOption(D6O_SERVERID);
+ if (server_id){
+ // Check that the server is testing if server identifier received in the
+ // query, matches server identifier used by the server.
+ if (getServerID()->getData() != server_id->getData()){
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL_DATA,
+ DHCP6_PACKET_MISMATCH_SERVERID_DROP)
+ .arg(pkt->getName())
+ .arg(pkt->getTransid())
+ .arg(pkt->getIface());
+ return (false);
+ }
+ }
+ // No server id received or server ids matching.
+ return (true);
}
bool Dhcpv6Srv::run() {
@@ -306,8 +307,8 @@ bool Dhcpv6Srv::run() {
}
// Check if received query carries server identifier matching
// server identifier being used by the server.
- if (!testServerID(query)){
- continue;
+ if (!testServerID(query)) {
+ continue;
}
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL, DHCP6_PACKET_RECEIVED)
diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
index d037b24..d44b222 100644
--- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
+++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
@@ -1076,9 +1076,9 @@ TEST_F(Dhcpv6SrvTest, sanityCheck) {
// Check that the server is testing if server identifier received in the
// query, matches server identifier used by the server.
TEST_F(Dhcpv6SrvTest, testServerID) {
- NakedDhcpv6Srv srv(0);
+ NakedDhcpv6Srv srv(0);
- Pkt6Ptr req = Pkt6Ptr(new Pkt6(DHCPV6_REQUEST, 1234));
+ Pkt6Ptr req = Pkt6Ptr(new Pkt6(DHCPV6_REQUEST, 1234));
std::vector<uint8_t> bin;
// diud_llt constructed with: time = 0, macaddress = 00:00:00:00:00:00
More information about the bind10-changes
mailing list