projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add inline fls() function for linux
[project/netifd.git]
/
interface.c
diff --git
a/interface.c
b/interface.c
index
f08fee0
..
d8f7de3
100644
(file)
--- a/
interface.c
+++ b/
interface.c
@@
-5,6
+5,7
@@
#include "netifd.h"
#include "device.h"
#include "interface.h"
#include "netifd.h"
#include "device.h"
#include "interface.h"
+#include "interface-ip.h"
#include "proto.h"
#include "ubus.h"
#include "config.h"
#include "proto.h"
#include "ubus.h"
#include "config.h"
@@
-88,8
+89,9
@@
interface_event(struct interface *iface, enum interface_event ev)
static void
mark_interface_down(struct interface *iface)
{
static void
mark_interface_down(struct interface *iface)
{
+ interface_del_all_routes(iface);
interface_del_ctx_addr(iface, NULL);
interface_del_ctx_addr(iface, NULL);
- device_release(
iface->main_dev.
dev);
+ device_release(
&iface->main_
dev);
iface->state = IFS_DOWN;
}
iface->state = IFS_DOWN;
}
@@
-101,7
+103,7
@@
__interface_set_up(struct interface *iface)
if (iface->state != IFS_DOWN)
return 0;
if (iface->state != IFS_DOWN)
return 0;
- ret = device_claim(
iface->main_dev.
dev);
+ ret = device_claim(
&iface->main_
dev);
if (ret)
return ret;
if (ret)
return ret;
@@
-237,6
+239,7
@@
interface_alloc(const char *name, struct blob_attr *attr)
}
netifd_ubus_add_interface(iface);
}
netifd_ubus_add_interface(iface);
+ config_set_state(&iface->config, attr);
return iface;
}
return iface;
}