projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add routes/gateway support
[project/netifd.git]
/
interface.c
diff --git
a/interface.c
b/interface.c
index
ef176f6
..
dd303ef
100644
(file)
--- a/
interface.c
+++ b/
interface.c
@@
-26,7
+26,7
@@
void interface_add_error(struct interface *iface, const char *subsystem,
{
struct interface_error *error;
int i, len = 0;
{
struct interface_error *error;
int i, len = 0;
- int *datalen;
+ int *datalen
= NULL
;
char *dest;
if (n_data) {
char *dest;
if (n_data) {
@@
-64,6
+64,7
@@
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_ctx_addr(iface, NULL);
release_device(iface->main_dev.dev);
iface->state = IFS_DOWN;
}
release_device(iface->main_dev.dev);
iface->state = IFS_DOWN;
}
@@
-103,6
+104,7
@@
__set_interface_down(struct interface *iface, bool force)
iface->state = IFS_TEARDOWN;
interface_event(iface, IFEV_DOWN);
iface->state = IFS_TEARDOWN;
interface_event(iface, IFEV_DOWN);
+ interface_del_all_routes(iface);
interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
}
interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
}
@@
-189,6
+191,8
@@
alloc_interface(const char *name, struct uci_section *s)
strncpy(iface->name, name, sizeof(iface->name) - 1);
list_add(&iface->list, &interfaces);
INIT_LIST_HEAD(&iface->errors);
strncpy(iface->name, name, sizeof(iface->name) - 1);
list_add(&iface->list, &interfaces);
INIT_LIST_HEAD(&iface->errors);
+ INIT_LIST_HEAD(&iface->address);
+ INIT_LIST_HEAD(&iface->routes);
proto_attach_interface(iface, s);
proto_attach_interface(iface, s);