Commit 78c84feb authored by Matthieu Boutier's avatar Matthieu Boutier Committed by Juliusz Chroboczek

Fix bug which may consider inexistent disambiguation entries.

This patch fix the non-disambiguation behaviour: we were looking to
disambiguation entries to remove or replace, which is a complete non-sense,
since there should not being disambiguation entries.
parent fccc49a8
...@@ -266,7 +266,12 @@ kinstall_route(const struct babel_route *route) ...@@ -266,7 +266,12 @@ kinstall_route(const struct babel_route *route)
format_prefix(route->src->prefix, route->src->plen), format_prefix(route->src->prefix, route->src->plen),
format_prefix(route->src->src_prefix, route->src->src_plen)); format_prefix(route->src->src_prefix, route->src->src_plen));
/* Install source-specific conflicting routes */ /* Install source-specific conflicting routes */
if(!kernel_disambiguate(v4)) { if(kernel_disambiguate(v4)) {
to_zone(route, &zone);
rc = add_route(&zone, route);
goto end;
}
stream = route_stream(1); stream = route_stream(1);
if(!stream) { if(!stream) {
fprintf(stderr, "Couldn't allocate route stream.\n"); fprintf(stderr, "Couldn't allocate route stream.\n");
...@@ -289,7 +294,6 @@ kinstall_route(const struct babel_route *route) ...@@ -289,7 +294,6 @@ kinstall_route(const struct babel_route *route)
chg_route(&zone, rt2, route); chg_route(&zone, rt2, route);
} }
route_stream_done(stream); route_stream_done(stream);
}
/* Non conflicting case */ /* Non conflicting case */
to_zone(route, &zone); to_zone(route, &zone);
...@@ -298,6 +302,7 @@ kinstall_route(const struct babel_route *route) ...@@ -298,6 +302,7 @@ kinstall_route(const struct babel_route *route)
rc = add_route(&zone, route); rc = add_route(&zone, route);
else else
rc = chg_route(&zone, rt1, route); rc = chg_route(&zone, rt1, route);
end:
if(rc < 0) { if(rc < 0) {
int save = errno; int save = errno;
perror("kernel_route(ADD)"); perror("kernel_route(ADD)");
...@@ -319,8 +324,14 @@ kuninstall_route(const struct babel_route *route) ...@@ -319,8 +324,14 @@ kuninstall_route(const struct babel_route *route)
debugf("uninstall_route(%s from %s)\n", debugf("uninstall_route(%s from %s)\n",
format_prefix(route->src->prefix, route->src->plen), format_prefix(route->src->prefix, route->src->plen),
format_prefix(route->src->src_prefix, route->src->src_plen)); format_prefix(route->src->src_prefix, route->src->src_plen));
/* Remove the route, or change if the route was solving a conflict. */
to_zone(route, &zone); to_zone(route, &zone);
if(kernel_disambiguate(v4)) {
rc = del_route(&zone, route);
if(rc < 0)
perror("kernel_route(FLUSH)");
return rc;
}
/* Remove the route, or change if the route was solving a conflict. */
rt1 = conflict_solution(route); rt1 = conflict_solution(route);
if(rt1 == NULL) if(rt1 == NULL)
rc = del_route(&zone, route); rc = del_route(&zone, route);
...@@ -330,7 +341,6 @@ kuninstall_route(const struct babel_route *route) ...@@ -330,7 +341,6 @@ kuninstall_route(const struct babel_route *route)
perror("kernel_route(FLUSH)"); perror("kernel_route(FLUSH)");
/* Remove source-specific conflicting routes */ /* Remove source-specific conflicting routes */
if(!kernel_disambiguate(v4)) {
stream = route_stream(1); stream = route_stream(1);
if(!stream) { if(!stream) {
fprintf(stderr, "Couldn't allocate route stream.\n"); fprintf(stderr, "Couldn't allocate route stream.\n");
...@@ -352,7 +362,6 @@ kuninstall_route(const struct babel_route *route) ...@@ -352,7 +362,6 @@ kuninstall_route(const struct babel_route *route)
chg_route(&zone, route, rt2); chg_route(&zone, route, rt2);
} }
route_stream_done(stream); route_stream_done(stream);
}
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment