Make interfaces pointer private to interfaces.c and add get_interfaces()

accessor.
This commit is contained in:
Todd C. Miller
2012-10-25 13:15:52 -04:00
parent 319fe95d08
commit 929aef0754
6 changed files with 17 additions and 13 deletions

View File

@@ -71,7 +71,7 @@ addr_matches_if(char *n)
addr.ip4.s_addr = inet_addr(n);
}
for (ifp = interfaces; ifp != NULL; ifp = ifp->next) {
for (ifp = get_interfaces(); ifp != NULL; ifp = ifp->next) {
if (ifp->family != family)
continue;
switch (family) {
@@ -154,7 +154,7 @@ addr_matches_if_netmask(char *n, char *m)
}
#endif /* HAVE_STRUCT_IN6_ADDR */
for (ifp = interfaces; ifp != NULL; ifp = ifp->next) {
for (ifp = get_interfaces(); ifp != NULL; ifp = ifp->next) {
if (ifp->family != family)
continue;
switch (family) {