- LIBCFS_FREE(ipaddrs, nip * sizeof(*ipaddrs));
-}
-
-static int
-lnet_ipaddr_enumerate (__u32 **ipaddrsp)
-{
- int up;
- __u32 netmask;
- __u32 *ipaddrs;
- __u32 *ipaddrs2;
- int nip;
- char **ifnames;
- int nif = lnet_ipif_enumerate(&ifnames);
- int i;
- int rc;
-
- if (nif <= 0)
- return nif;
-
- LIBCFS_ALLOC(ipaddrs, nif * sizeof(*ipaddrs));
- if (ipaddrs == NULL) {
- CERROR("Can't allocate ipaddrs[%d]\n", nif);
- lnet_ipif_free_enumeration(ifnames, nif);
- return -ENOMEM;
- }
-
- for (i = nip = 0; i < nif; i++) {
- if (!strcmp(ifnames[i], "lo"))
+ struct lnet_inetdev *ifaces = NULL;
+ struct net_device *dev;
+ int nalloc = 0;
+ int nip = 0;
+
+ rtnl_lock();
+ for_each_netdev(ns, dev) {
+ int flags = dev_get_flags(dev);
+ struct in_device *in_dev;
+ int node_id;
+ int cpt;
+
+ if (flags & IFF_LOOPBACK) /* skip the loopback IF */