diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-05 22:03:21 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-05 22:03:21 +0100 |
commit | f2d8e6801e88a84b1e57da72d078d7569598a5f5 (patch) | |
tree | abf191000fb802dedd87b8b78abcc2f12c45d8b8 /nest/iface.c | |
parent | 69b2f63d9a477ab5d083773e16ca15ed2e570144 (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/iface.c')
-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 9462b634..23a82ac5 100644 --- a/nest/iface.c +++ b/nest/iface.c @@ -449,7 +449,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; } @@ -459,8 +459,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)); |