projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
do not clear device state for devices created by proto-up with address-external set
[project/netifd.git]
/
proto-shell.c
diff --git
a/proto-shell.c
b/proto-shell.c
index
eb60fc1
..
a22c0e3
100644
(file)
--- a/
proto-shell.c
+++ b/
proto-shell.c
@@
-242,6
+242,7
@@
proto_shell_update_link(struct proto_shell_state *state, struct blob_attr **tb)
{
struct interface_ip_settings *ip;
struct blob_attr *cur;
{
struct interface_ip_settings *ip;
struct blob_attr *cur;
+ int dev_create = 1;
bool addr_ext = false;
bool up;
bool addr_ext = false;
bool up;
@@
-254,6
+255,12
@@
proto_shell_update_link(struct proto_shell_state *state, struct blob_attr **tb)
return 0;
}
return 0;
}
+ if ((cur = tb[NOTIFY_ADDR_EXT]) != NULL) {
+ addr_ext = blobmsg_get_bool(cur);
+ if (addr_ext)
+ dev_create = 2;
+ }
+
if (!tb[NOTIFY_IFNAME]) {
if (!state->proto.iface->main_dev.dev)
return UBUS_STATUS_INVALID_ARGUMENT;
if (!tb[NOTIFY_IFNAME]) {
if (!state->proto.iface->main_dev.dev)
return UBUS_STATUS_INVALID_ARGUMENT;
@@
-262,7
+269,7
@@
proto_shell_update_link(struct proto_shell_state *state, struct blob_attr **tb)
device_remove_user(&state->l3_dev);
device_add_user(&state->l3_dev,
device_remove_user(&state->l3_dev);
device_add_user(&state->l3_dev,
- device_get(blobmsg_data(tb[NOTIFY_IFNAME]),
tru
e));
+ device_get(blobmsg_data(tb[NOTIFY_IFNAME]),
dev_creat
e));
state->proto.iface->l3_dev = &state->l3_dev;
device_claim(&state->l3_dev);
}
state->proto.iface->l3_dev = &state->l3_dev;
device_claim(&state->l3_dev);
}
@@
-270,9
+277,6
@@
proto_shell_update_link(struct proto_shell_state *state, struct blob_attr **tb)
ip = &state->proto.iface->proto_ip;
interface_update_start(state->proto.iface);
ip = &state->proto.iface->proto_ip;
interface_update_start(state->proto.iface);
- if ((cur = tb[NOTIFY_ADDR_EXT]) != NULL)
- addr_ext = blobmsg_get_bool(cur);
-
if ((cur = tb[NOTIFY_IPADDR]) != NULL)
proto_shell_parse_addr_list(ip, cur, false, addr_ext);
if ((cur = tb[NOTIFY_IPADDR]) != NULL)
proto_shell_parse_addr_list(ip, cur, false, addr_ext);
@@
-391,7
+395,7
@@
proto_shell_notify(struct interface_proto_state *proto, struct blob_attr *attr)
}
}
}
}
-struct interface_proto_state *
+st
atic st
ruct interface_proto_state *
proto_shell_attach(const struct proto_handler *h, struct interface *iface,
struct blob_attr *attr)
{
proto_shell_attach(const struct proto_handler *h, struct interface *iface,
struct blob_attr *attr)
{
@@
-600,7
+604,7
@@
static void proto_shell_add_script(const char *name)
pclose(f);
}
pclose(f);
}
-void __init proto_shell_init(void)
+
static
void __init proto_shell_init(void)
{
glob_t g;
int main_fd;
{
glob_t g;
int main_fd;