Use SLIST and STAILQ macros instead of doing headless singly linked

lists manually.  As a bonus we now use a tail queue for ldap.c and
sudoreplay.c.
This commit is contained in:
Todd C. Miller
2013-10-22 09:08:09 -06:00
parent 923edabe6c
commit f85106ea67
17 changed files with 299 additions and 311 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2012 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 2010-2013 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -51,7 +51,7 @@
# define INADDR_NONE ((unsigned int)-1)
#endif
static struct interface *interfaces;
static struct interface_list interfaces;
/*
* Parse a space-delimited list of IP address/netmask pairs and
@@ -95,17 +95,16 @@ set_interfaces(const char *ai)
continue;
}
}
ifp->next = interfaces;
interfaces = ifp;
SLIST_INSERT_HEAD(&interfaces, ifp, entries);
}
efree(addrinfo);
debug_return;
}
struct interface *
struct interface_list *
get_interfaces(void)
{
return interfaces;
return &interfaces;
}
void