diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-05 21:55:18 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-05 21:55:18 +0100 |
commit | 716b904f4eb14349cdf66656eea0d90b040d51e5 (patch) | |
tree | 73efc901c3c66996255ec4807639b81314b6b876 /nest | |
parent | fff79b1c1e0577f487b4fb67f79a74b054d734b6 (diff) |
Filter: Make ifname attribute modifiable
Allow to change an interface associated with a route by setting
ifname attribute. It will also change the route to a direct one.
Diffstat (limited to 'nest')
-rw-r--r-- | nest/iface.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nest/iface.c b/nest/iface.c index 3dd45065..56de1f5c 100644 --- a/nest/iface.c +++ b/nest/iface.c @@ -441,7 +441,7 @@ if_find_by_name(char *name) struct iface *i; WALK_LIST(i, iface_list) - if (!strcmp(i->name, name)) + if (!strcmp(i->name, name) && !(i->flags & IF_SHUTDOWN)) return i; return NULL; } @@ -451,8 +451,9 @@ if_get_by_name(char *name) { struct iface *i; - if (i = if_find_by_name(name)) - return i; + WALK_LIST(i, iface_list) + if (!strcmp(i->name, name)) + return i; /* No active iface, create a dummy */ i = mb_allocz(if_pool, sizeof(struct iface)); |