#include <asm/types.h>
/* not defined for gcc -ansi */
-typedef uint64_t __u64;
-typedef int64_t __s64;
+typedef unsigned long long __u64;
+typedef signed long long __s64;
#include <netlink/netlink.h>
#include <netlink/route/addr.h>
free(p);
}
+static inline void free_nid_list(struct nid_list *head)
+{
+ struct nid_list *p;
+ for (p = NULL; head; head = head->next) {
+ if (p)
+ free(p);
+ p = head;
+ }
+ if (p)
+ free(p);
+}
+
static void do_slices_autoconf(struct prefix_list *head)
{
DIR *dp;
struct vc_net_nx addr;
struct prefix_list *i;
struct nid_list *current = NULL, *n;
+ static struct nid_list *previous = NULL;
if ((dp = opendir("/proc/virtnet")) == NULL)
return;
}
}
closedir(dp);
+
+ free_nid_list(previous);
+ previous = current;
}
static int add_prefix(struct prefix_list *head, struct prefixmsg *msg,