Skip to content

Commit 9182a1a

Browse files
author
marek
committed
[batman] fix unreachable route cleanup routine
In some cases an old unreachable route was not properly deleted when batman started. Instead batman printed some obscure error message. git-svn-id: http://downloads.open-mesh.org/svn/batman/trunk/batman@1275 45894c77-fb22-0410-b583-ff6e7d5dbf6c
1 parent 4873a2c commit 9182a1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

linux/route.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ void add_del_route(uint32_t dest, uint8_t netmask, uint32_t router, uint32_t src
8585
inet_ntop(AF_INET, &router, str2, sizeof (str2));
8686
inet_ntop(AF_INET, &src_ip, str3, sizeof(str3));
8787

88-
8988
if (policy_routing_script != NULL) {
9089
dprintf(policy_routing_pipe, "ROUTE %s %s %s %i %s %s %i %s %i\n", (route_action == ROUTE_DEL ? "del" : "add"), route_type_to_string_script[route_type], str1, netmask, str2, str3, ifi, dev, rt_table);
9190
return;
@@ -781,6 +780,10 @@ int flush_routes_rules(int8_t is_rule)
781780
break;
782781
}
783782

783+
/* sometimes dest and router are not reset */
784+
if (rule_type == ROUTE_TYPE_UNREACHABLE)
785+
dest = router = 0;
786+
784787
add_del_route(dest, rtm->rtm_dst_len, router, 0, ifi, "unknown", rtm->rtm_table, rule_type, ROUTE_DEL);
785788
}
786789

0 commit comments

Comments
 (0)