about summary refs log tree commit diff
path: root/inet/test_ifindex.c
diff options
context:
space:
mode:
Diffstat (limited to 'inet/test_ifindex.c')
-rw-r--r--inet/test_ifindex.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/inet/test_ifindex.c b/inet/test_ifindex.c
index d44e0b1cb4..0441bf0feb 100644
--- a/inet/test_ifindex.c
+++ b/inet/test_ifindex.c
@@ -51,6 +51,11 @@ main (void)
       printf ("%3d", ni = if_nametoindex (p->if_name));
       printf ("%15s", if_indextoname (p->if_index, buf));
       result = (ni != p->if_index || (strcmp (buf, p->if_name)));
+      if (ni == p->if_index)
+	/* We have to make sure that this is not an alias with the
+	   same interface number.  */
+	if (p->if_index == if_nametoindex (buf))
+	  result = 0;
       printf ("%10s", result ? "fail" : "okay");
       printf ("\n");
       failures += result;