Commit 5be5e6a6 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[1239] lo/lo0 interface detection fix in DHCPv4/DHCPv6 server tests.

parent e722aee2
...@@ -58,7 +58,11 @@ public: ...@@ -58,7 +58,11 @@ public:
Dhcpv4SrvTest() { Dhcpv4SrvTest() {
unlink(INTERFACE_FILE); unlink(INTERFACE_FILE);
fstream fakeifaces(INTERFACE_FILE, ios::out|ios::trunc); fstream fakeifaces(INTERFACE_FILE, ios::out|ios::trunc);
if (if_nametoindex("lo")>0) {
fakeifaces << "lo ::1"; fakeifaces << "lo ::1";
} else if (if_nametoindex("lo0")>0) {
fakeifaces << "lo0 ::1";
}
fakeifaces.close(); fakeifaces.close();
} }
......
...@@ -53,9 +53,12 @@ public: ...@@ -53,9 +53,12 @@ public:
Dhcpv6SrvTest() { Dhcpv6SrvTest() {
unlink(INTERFACE_FILE); unlink(INTERFACE_FILE);
fstream fakeifaces(INTERFACE_FILE, ios::out|ios::trunc); fstream fakeifaces(INTERFACE_FILE, ios::out|ios::trunc);
if (if_nametoindex("lo")>0) {
fakeifaces << "lo ::1"; fakeifaces << "lo ::1";
} else if (if_nametoindex("lo0")>0) {
fakeifaces << "lo0 ::1";
}
fakeifaces.close(); fakeifaces.close();
} }
~Dhcpv6SrvTest() { ~Dhcpv6SrvTest() {
unlink(INTERFACE_FILE); unlink(INTERFACE_FILE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment