Ignore loopback interfaces

This commit is contained in:
roy 2015-10-12 09:28:15 +00:00
parent afc9672b0b
commit 83969876a9
1 changed files with 2 additions and 0 deletions

View File

@ -277,6 +277,8 @@ struct ifi_info *get_ifi_info(int family, int doaliases)
flags = ifrcopy.ifr_flags;
if ((flags & IFF_UP) == 0)
continue; /* ignore if interface not up */
if ((flags & IFF_LOOPBACK))
continue; /* ignore loopback interfaces */
/* Skip addresses we can't use */
#ifdef SIOCGIFAFLAG_IN