iproute: fix parsing and matching of of "short" IP addrs like 10/8

function                                             old     new   delta
print_route                                         1613    1813    +200
get_addr_1                                           209     258     +49
get_prefix                                           393     356     -37
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 249/-37)           Total: 212 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2011-02-23 01:20:44 +01:00
parent bac0a25f72
commit 3bb235c3b5
4 changed files with 74 additions and 38 deletions

View File

@ -393,7 +393,7 @@ void FAST_FUNC parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, in
if (rta->rta_type <= max) {
tb[rta->rta_type] = rta;
}
rta = RTA_NEXT(rta,len);
rta = RTA_NEXT(rta, len);
}
if (len) {
bb_error_msg("deficit %d, rta_len=%d!", len, rta->rta_len);