summaryrefslogtreecommitdiff
path: root/nest/iface.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-01-01 12:02:20 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2012-01-01 12:14:42 +0100
commit69a8259c5e438f949bd58b1a2f8e1d12a49f9216 (patch)
tree5d685368ce58732ce4a9133b5f5bc43b20b78476 /nest/iface.c
parentc32c3f88f0c8788118ed3701c11a5aea2aaf9356 (diff)
Allows sticky link-local neighbors.
Allows using NEF_STICKY neighbors with link-local addresses. This is used for static route nexthops, they can be specified like fe80::1%eth0 .
Diffstat (limited to 'nest/iface.c')
-rw-r--r--nest/iface.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/nest/iface.c b/nest/iface.c
index bf57a9b1..b8b214e5 100644
--- a/nest/iface.c
+++ b/nest/iface.c
@@ -424,6 +424,24 @@ if_find_by_name(char *name)
return NULL;
}
+struct iface *
+if_get_by_name(char *name)
+{
+ struct iface *i;
+
+ if (i = if_find_by_name(name))
+ return i;
+
+ /* No active iface, create a dummy */
+ i = mb_allocz(if_pool, sizeof(struct iface));
+ strncpy(i->name, name, sizeof(i->name)-1);
+ i->flags = IF_SHUTDOWN;
+ init_list(&i->addrs);
+ init_list(&i->neighbors);
+ add_tail(&iface_list, &i->n);
+ return i;
+}
+
struct ifa *kif_choose_primary(struct iface *i);
static int