From: Markus Date: Wed, 3 Feb 2016 13:29:48 +0000 (+0100) Subject: main: avoid adding redundant interfaces X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5bd3096cf8309f11d07b8cce5e7a515f526c3674;p=project%2Frelayd.git main: avoid adding redundant interfaces Signed-off-by: Felix Fietkau --- diff --git a/main.c b/main.c index bd330ee..b3c13f7 100644 --- a/main.c +++ b/main.c @@ -653,6 +653,11 @@ static struct relayd_interface *alloc_interface(const char *ifname, bool managed if (strlen(ifname) >= IFNAMSIZ) return NULL; + list_for_each_entry(rif, &interfaces, list) { + if (!strncmp(rif->ifname, ifname, IFNAMSIZ)) + return rif; + } + rif = calloc(1, sizeof(*rif)); if (!rif) return NULL;