BIND 10 master, updated. 56aa312f698ef597a9d819e5fa28e2b75a9f321b Merge branch 'trac1361'
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Oct 28 16:53:12 UTC 2011
The branch, master has been updated
via 56aa312f698ef597a9d819e5fa28e2b75a9f321b (commit)
via 410464e7b0f37c8ba149e543c789a598914fc7d7 (commit)
from b16e9d26953cd7117d14ea8dde9e739cb34cb878 (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 56aa312f698ef597a9d819e5fa28e2b75a9f321b
Merge: b16e9d26953cd7117d14ea8dde9e739cb34cb878 410464e7b0f37c8ba149e543c789a598914fc7d7
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Fri Oct 28 18:48:41 2011 +0200
Merge branch 'trac1361'
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp6/tests/iface_mgr_unittest.cc | 39 ++++++----------------------
1 files changed, 9 insertions(+), 30 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp6/tests/iface_mgr_unittest.cc b/src/bin/dhcp6/tests/iface_mgr_unittest.cc
index 5ce73f8..f126e6a 100644
--- a/src/bin/dhcp6/tests/iface_mgr_unittest.cc
+++ b/src/bin/dhcp6/tests/iface_mgr_unittest.cc
@@ -67,41 +67,20 @@ public:
// during running tests is required.
TEST_F(IfaceMgrTest, loDetect) {
- unlink("interfaces.txt");
-
- ofstream interfaces("interfaces.txt", ios::ate);
- interfaces << "lo ::1";
- interfaces.close();
-
- NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
- IOAddress loAddr("::1");
- IOAddress mcastAddr("ff02::1:2");
-
- // bind multicast socket to port 10547
- int socket1 = ifacemgr->openSocket("lo", mcastAddr, 10547);
- // this fails on BSD (there's no lo interface there)
-
- // poor man's interface dection
+ // poor man's interface detection
// it will go away as soon as proper interface detection
// is implemented
- if (socket1>0) {
+ if (if_nametoindex("lo")>0) {
cout << "This is Linux, using lo as loopback." << endl;
- close(socket1);
+ sprintf(LOOPBACK, "lo");
+ } else if (if_nametoindex("lo0")>0) {
+ cout << "This is BSD, using lo0 as loopback." << endl;
+ sprintf(LOOPBACK, "lo0");
} else {
- // this fails on Linux and succeeds on BSD
- socket1 = ifacemgr->openSocket("lo0", mcastAddr, 10547);
- if (socket1>0) {
- sprintf(LOOPBACK, "lo0");
- cout << "This is BSD, using lo0 as loopback." << endl;
- close(socket1);
- } else {
- cout << "Failed to detect loopback interface. Neither "
- << "lo or lo0 worked. I give up." << endl;
- ASSERT_TRUE(false);
- }
+ cout << "Failed to detect loopback interface. Neither "
+ << "lo or lo0 worked. I give up." << endl;
+ ASSERT_TRUE(false);
}
-
- delete ifacemgr;
}
// uncomment this test to create packet writer. It will
More information about the bind10-changes
mailing list