summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2017-04-12 19:53:20 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2017-04-22 23:37:36 +0200
commit11cb9cfbb088740ee7ee5e6c6b661958c0f962cb (patch)
tree7d6740bffa2b9a8f05983d8a5dc79bedc73e7dc6 /interface.c
parent4375d1bc56301dd977ab102db995e07aa930d4a2 (diff)
ubus: add interface method to trigger renew event
Not all topology or connectivity changes may be detected by netifd, depending on the underlying technology (e.g. VPN software); this adds a way to explicitly trigger a renew. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/interface.c b/interface.c
index f150f7d..593b049 100644
--- a/interface.c
+++ b/interface.c
@@ -1076,6 +1076,15 @@ interface_set_down(struct interface *iface)
return 0;
}
+int
+interface_renew(struct interface *iface)
+{
+ if (iface->state == IFS_TEARDOWN || iface->state == IFS_DOWN)
+ return -1;
+
+ return interface_proto_event(iface->proto, PROTO_CMD_RENEW, false);
+}
+
void
interface_start_pending(void)
{