summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-07 01:17:31 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-01-07 01:17:31 +0100
commitbcf809779eb43adfc598746e02d522751d9aaeac (patch)
tree17a61266912d3aab7bc3bc06c97a9af5b17a9f6b
parent3be8c8cc46188511ccb1128a689b3e9c9322beac (diff)
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 <pablo@netfilter.org>
-rw-r--r--src/iftable.c3
1 files changed, 2 insertions, 1 deletions
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;
}