BIND 10 pd-ietf-demo, updated. f852ddb9defdd0ccc930b96eb5df406739f07ea2 [pd-ietf-demo] Set hops value to 0 in DHCPv4 server responses.

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Oct 18 08:52:44 UTC 2013


The branch, pd-ietf-demo has been updated
       via  f852ddb9defdd0ccc930b96eb5df406739f07ea2 (commit)
      from  0ecb70eacec59f780173750979b480678dad203b (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 f852ddb9defdd0ccc930b96eb5df406739f07ea2
Author: Marcin Siodelski <marcin at isc.org>
Date:   Fri Oct 18 10:52:38 2013 +0200

    [pd-ietf-demo] Set hops value to 0 in DHCPv4 server responses.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/dhcp4/dhcp4_srv.cc |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc
index 4177125..169326a 100644
--- a/src/bin/dhcp4/dhcp4_srv.cc
+++ b/src/bin/dhcp4/dhcp4_srv.cc
@@ -354,7 +354,9 @@ Dhcpv4Srv::run() {
 
         adjustRemoteAddr(query, rsp);
 
-        if (!rsp->getHops()) {
+        // If not client's query wasn't relayed, send response to the
+        // DHCP client's port. Otherwise, to server/relay port.
+        if (!query->getHops()) {
             rsp->setRemotePort(DHCP4_CLIENT_PORT);
         } else {
             rsp->setRemotePort(DHCP4_SERVER_PORT);
@@ -558,7 +560,9 @@ Dhcpv4Srv::copyDefaultFields(const Pkt4Ptr& question, Pkt4Ptr& answer) {
     answer->setCiaddr(question->getCiaddr());
 
     answer->setSiaddr(IOAddress("0.0.0.0")); // explicitly set this to 0
-    answer->setHops(question->getHops());
+    // According to RFC2131, the hops value in server's response is always
+    // equal to 0.
+    answer->setHops(0);
 
     // copy MAC address
     answer->setHWAddr(question->getHWAddr());



More information about the bind10-changes mailing list