Commit 0734181f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Monitor interfaces too.

parent 2a8350a9
...@@ -40,6 +40,7 @@ THE SOFTWARE. ...@@ -40,6 +40,7 @@ THE SOFTWARE.
#include "message.h" #include "message.h"
#include "route.h" #include "route.h"
#include "configuration.h" #include "configuration.h"
#include "local.h"
#include "xroute.h" #include "xroute.h"
struct interface *interfaces = NULL; struct interface *interfaces = NULL;
...@@ -89,6 +90,8 @@ add_interface(char *ifname, struct interface_conf *if_conf) ...@@ -89,6 +90,8 @@ add_interface(char *ifname, struct interface_conf *if_conf)
else else
last_interface()->next = ifp; last_interface()->next = ifp;
local_notify_interface(ifp, LOCAL_ADD);
return ifp; return ifp;
} }
...@@ -116,8 +119,13 @@ flush_interface(char *ifname) ...@@ -116,8 +119,13 @@ flush_interface(char *ifname)
else else
interfaces = ifp->next; interfaces = ifp->next;
local_notify_interface(ifp, LOCAL_FLUSH);
if(ifp->conf != NULL && ifp->conf != default_interface_conf) if(ifp->conf != NULL && ifp->conf != default_interface_conf)
flush_ifconf(ifp->conf); flush_ifconf(ifp->conf);
local_notify_interface(ifp, LOCAL_FLUSH);
free(ifp); free(ifp);
} }
...@@ -453,11 +461,14 @@ interface_up(struct interface *ifp, int up) ...@@ -453,11 +461,14 @@ interface_up(struct interface *ifp, int up)
ifp->numll = 0; ifp->numll = 0;
} }
local_notify_interface(ifp, LOCAL_CHANGE);
return 1; return 1;
fail: fail:
assert(up); assert(up);
interface_up(ifp, 0); interface_up(ifp, 0);
local_notify_interface(ifp, LOCAL_CHANGE);
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment