BIND 10 #1361: IfaceMgr.loDetect test fails on NetBSD

BIND 10 Development do-not-reply at isc.org
Fri Oct 28 17:20:53 UTC 2011


#1361: IfaceMgr.loDetect test fails on NetBSD
-------------------------------------+-------------------------------------
                   Reporter:  tomek  |                 Owner:  UnAssigned
                       Type:         |                Status:  reviewing
  defect                             |             Milestone:  Sprint-
                   Priority:  minor  |  DHCP-20111109
                  Component:  dhcp   |            Resolution:
                   Keywords:         |             Sensitive:  0
            Defect Severity:  N/A    |           Sub-Project:  DHCP
Feature Depending on Ticket:         |  Estimated Difficulty:  0
        Add Hours to Ticket:  0      |           Total Hours:  0
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by jinmei):

 Replying to [comment:2 tomek]:
 > Fix implemented. It works on Linux, Mac OS X and NetBSD.
 >
 > Code on branch trac1361. Please review.

 I already gave it a go for urgent care.

 Some additional comments

 - s/or/nor/?
 {{{
 +        cout << "Failed to detect loopback interface. Neither "
 +             << "lo or lo0 worked. I give up." << endl;
 }}}
 - the use of sprintf is risky.  In this case we only use constant string,
   so we should be fine with char*:
 {{{
 namespace {  // btw I suggest hiding this stuff in an unnamed namedpace
 const char* LOOPBACK = "lo0";

 ....
     if (if_nametoindex("lo")>0) {
         LOOPBACK = "lo";
 ...
 }}}
 - according to BIND 9 coding guideline we add spaces around '>', etc.
 {{{
     if (if_nametoindex("lo") > 0) {
 }}}
 - this seems to be an ugly hack.
 {{{
 +        ASSERT_TRUE(false);
 }}}
 - when you complete this branch, please delete it from the public repo.

-- 
Ticket URL: <http://bind10.isc.org/ticket/1361#comment:5>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list