Consider IFF_LOOPBACK before IFF_BROADCAST.

The IPv6 loopback interface on AIX has both IFF_BROADCAST and IFF_LOOPBACK set. Checking IFF_BROADCAST first erroneously makes it appear as an Ethernet device.
This commit is contained in:
david 2011-09-26 22:26:50 +00:00
parent d5b0b9bf43
commit 8d964ad4e9
2 changed files with 24 additions and 3 deletions

View file

@ -374,12 +374,12 @@ intf_set(intf_t *intf, const struct intf_entry *entry)
static void
_intf_set_type(struct intf_entry *entry)
{
if ((entry->intf_flags & INTF_FLAG_BROADCAST) != 0)
if ((entry->intf_flags & INTF_FLAG_LOOPBACK) != 0)
entry->intf_type = INTF_TYPE_LOOPBACK;
else if ((entry->intf_flags & INTF_FLAG_BROADCAST) != 0)
entry->intf_type = INTF_TYPE_ETH;
else if ((entry->intf_flags & INTF_FLAG_POINTOPOINT) != 0)
entry->intf_type = INTF_TYPE_TUN;
else if ((entry->intf_flags & INTF_FLAG_LOOPBACK) != 0)
entry->intf_type = INTF_TYPE_LOOPBACK;
else
entry->intf_type = INTF_TYPE_OTHER;
}