summaryrefslogtreecommitdiffhomepage
path: root/proto-static.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-09-07 14:37:18 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-09-07 14:37:18 +0200
commit69b2dcb92b8402b9c6df4d6a041a890fe6468e18 (patch)
treec0acc6b30947ac7c8499d6d2f402abf837c9008c /proto-static.c
parent3fa53680c85a6e029a3e7b4d673bffee4795fa52 (diff)
add code for versioned lists and use it to manage addresses and routes
Diffstat (limited to 'proto-static.c')
-rw-r--r--proto-static.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/proto-static.c b/proto-static.c
index 04e2118..3868ab7 100644
--- a/proto-static.c
+++ b/proto-static.c
@@ -89,14 +89,13 @@ parse_addr(struct interface_proto_state *state, const char *str, bool v6, int ma
addr = calloc(1, sizeof(*addr));
addr->flags = v6 ? DEVADDR_INET6 : DEVADDR_INET4;
- addr->ctx = state;
addr->mask = mask;
if (!parse_ip_and_netmask(af, str, &addr->addr, &addr->mask)) {
interface_add_error(state->iface, "proto-static", "INVALID_ADDRESS", &str, 1);
free(addr);
return false;
}
- interface_add_address(state->iface, addr);
+ vlist_add(&state->iface->proto_addr, &addr->node);
return true;
}
@@ -132,7 +131,7 @@ parse_gateway_option(struct interface_proto_state *state, struct blob_attr *attr
}
route->mask = 0;
route->flags = DEVADDR_DEVICE | (v6 ? DEVADDR_INET6 : DEVADDR_INET4);
- interface_add_route(state->iface, route);
+ vlist_add(&state->iface->proto_route, &route->node);
return true;
}
@@ -211,7 +210,6 @@ static_handler(struct interface_proto_state *proto,
/* fall through */
case PROTO_CMD_TEARDOWN:
- interface_del_ctx_addr(state->proto.iface, proto);
break;
}
return ret;