interface-ip: mask out host bits in IPv4 route targets
[project/netifd.git] / proto-shell.c
index 26622165df51daaf8e513df5f3254319a2cfa0d2..bc3c41dcba85ac46cff02db88b9d3ee8e9fc2a57 100644 (file)
@@ -129,7 +129,7 @@ proto_shell_update_host_dep(struct proto_shell_dependency *dep)
        }
 
        if (!dep->any)
-               iface = interface_ip_add_target_route(&dep->host, dep->v6, iface);
+               iface = interface_ip_add_target_route(&dep->host, dep->v6, iface, false);
 
        if (!iface)
                goto out;
@@ -208,7 +208,7 @@ proto_shell_handler(struct interface_proto_state *proto,
                                return 0;
                        }
                /* if no script task is running */
-               /* fall through */
+               fallthrough;
                case S_IDLE:
                        action = "teardown";
                        state->renew_pending = false;
@@ -292,7 +292,7 @@ proto_shell_task_finish(struct proto_shell_state *state,
        case S_IDLE:
                if (task == &state->proto_task)
                        state->proto.proto_event(&state->proto, IFPEV_LINK_LOST);
-               /* fall through */
+               fallthrough;
        case S_SETUP:
                if (task == &state->proto_task)
                        proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN,
@@ -401,7 +401,7 @@ proto_shell_parse_route_list(struct interface *iface, struct blob_attr *attr,
                             bool v6)
 {
        struct blob_attr *cur;
-       int rem;
+       size_t rem;
 
        blobmsg_for_each_attr(cur, attr, rem) {
                if (blobmsg_type(cur) != BLOBMSG_TYPE_TABLE) {
@@ -418,7 +418,7 @@ proto_shell_parse_neighbor_list(struct interface *iface, struct blob_attr *attr,
                                bool v6)
 {
        struct blob_attr *cur;
-       int rem;
+       size_t rem;
 
        blobmsg_for_each_attr(cur, attr, rem) {
                if (blobmsg_type(cur) != BLOBMSG_TYPE_TABLE) {
@@ -434,7 +434,7 @@ static void
 proto_shell_parse_data(struct interface *iface, struct blob_attr *attr)
 {
        struct blob_attr *cur;
-       int rem;
+       size_t rem;
 
        blobmsg_for_each_attr(cur, attr, rem)
                interface_add_data(iface, cur);
@@ -597,7 +597,7 @@ fill_string_list(struct blob_attr *attr, char **argv, int max)
 {
        struct blob_attr *cur;
        int argc = 0;
-       int rem;
+       size_t rem;
 
        if (!attr)
                goto out;
@@ -671,7 +671,7 @@ proto_shell_notify_error(struct proto_shell_state *state, struct blob_attr **tb)
        struct blob_attr *cur;
        char *data[16];
        int n_data = 0;
-       int rem;
+       size_t rem;
 
        if (!tb[NOTIFY_ERROR])
                return UBUS_STATUS_INVALID_ARGUMENT;
@@ -764,7 +764,7 @@ proto_shell_setup_failed(struct proto_shell_state *state)
        switch (state->sm) {
        case S_IDLE:
                state->proto.proto_event(&state->proto, IFPEV_LINK_LOST);
-               /* fall through */
+               fallthrough;
        case S_SETUP:
                proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN, false);
                break;