From bcf809779eb43adfc598746e02d522751d9aaeac Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 7 Jan 2009 01:17:31 +0100 Subject: nlif: fix possible re-insertion in the list of interfaces This patch fixes a possible re-insertion of an existing entry in the list of interfaces. Signed-off-by: Pablo Neira Ayuso --- src/iftable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/iftable.c b/src/iftable.c index 7cca66f..3a4b0cb 100644 --- a/src/iftable.c +++ b/src/iftable.c @@ -98,7 +98,8 @@ static int iftable_add(struct nlmsghdr *n, void *arg) } strcpy(this->name, RTA_DATA(cb[IFLA_IFNAME])); - list_add(&this->head, &h->ifindex_hash[hash]); + if (!found) + list_add(&this->head, &h->ifindex_hash[hash]); return 1; } -- cgit v1.2.3