ouput format: fix active lease printing

Earlier ethernet address collection did not remove duplicated.  Basically
the problem was the same as in problem fixed in commit
ae7747db87, but this time affecting only
the ethernet addresses.  The fix is, as one can see, to make ethernet
collection to share structure with the lease, so that if one is wrong
both are wrong the same way.

Reported-by: Gilles Bouthenot <gilles.bouthenot@univ-fcomte.fr>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-12-07 21:23:01 +00:00
parent d8aae53968
commit fdc560bab9
5 changed files with 38 additions and 50 deletions

View file

@ -97,11 +97,6 @@ struct range_t {
unsigned long int touched;
unsigned long int backups;
};
struct macaddr_t {
char *ethernet;
char *ip;
struct macaddr_t *next;
};
enum ltype {
ACTIVE,
FREE,
@ -110,6 +105,7 @@ enum ltype {
struct leases_t {
union ipaddr_t ip; /* ip as key */
enum ltype type;
char *ethernet;
UT_hash_handle hh;
};
@ -130,7 +126,6 @@ struct leases_t *leases;
unsigned long int num_leases;
unsigned long int num_touches;
unsigned long int num_backups;
struct macaddr_t *macaddr;
/* Function prototypes */
int prepare_memory(void);