/* Test of <net/if.h> functions.
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <net/if.h>
-static struct if_nameindex ni;
-
/* We do not yet have replacements for if_* functions on systems that
lack a native <net/if.h>. */
#if HAVE_NET_IF_H && HAVE_IF_NAMEINDEX
#endif /* HAVE_NET_IF_H */
#if !HAVE_NET_IF_H || HAVE_IF_NAMEINDEX
- return !IF_NAMESIZE + ni.if_index + !!ni.if_name;
+ {
+ static struct if_nameindex ni;
+ return !IF_NAMESIZE + ni.if_index + !!ni.if_name;
+ }
#else
return 0;
#endif