projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add validation rules to proto static
[project/netifd.git]
/
interface-ip.c
diff --git
a/interface-ip.c
b/interface-ip.c
index
59cf828
..
3bd92cf
100644
(file)
--- a/
interface-ip.c
+++ b/
interface-ip.c
@@
-337,12
+337,12
@@
interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6)
const char *addr = strtok_r(source, "/", &saveptr);
const char *mask = strtok_r(NULL, "/", &saveptr);
const char *addr = strtok_r(source, "/", &saveptr);
const char *mask = strtok_r(NULL, "/", &saveptr);
- if (inet_pton(af, addr, &route->source) < 1) {
+ if (
!addr ||
inet_pton(af, addr, &route->source) < 1) {
DPRINTF("Failed to parse route source: %s\n", addr);
goto error;
}
DPRINTF("Failed to parse route source: %s\n", addr);
goto error;
}
- route->sourcemask =
atoi(mask
);
+ route->sourcemask =
(mask) ? atoi(mask) : ((af == AF_INET6) ? 128 : 32
);
}
if (is_proto_route) {
}
if (is_proto_route) {
@@
-648,6
+648,7
@@
interface_set_prefix_address(struct device_prefix_assignment *assignment,
addr.preferred_until = now;
if (!addr.valid_until || addr.valid_until - now > 7200)
addr.valid_until = now + 7200;
addr.preferred_until = now;
if (!addr.valid_until || addr.valid_until - now > 7200)
addr.valid_until = now + 7200;
+ system_del_address(l3_downlink, &addr); // Work around dangling prefix routes
system_add_address(l3_downlink, &addr);
if (prefix->iface) {
if (prefix->iface->ip6table)
system_add_address(l3_downlink, &addr);
if (prefix->iface) {
if (prefix->iface->ip6table)