diff options
author | Denys Vlasenko | 2018-02-08 08:42:37 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-02-14 17:38:40 +0100 |
commit | f5b9a2267803bcb1dad5e902dcdfeefb65a112c3 (patch) | |
tree | cf523d028046012a1da3f7926435e776b438c59c /networking/libiproute/ipneigh.c | |
parent | 112392232028fa2ce215043e7f9cf78f7ff74afe (diff) | |
download | busybox-f5b9a2267803bcb1dad5e902dcdfeefb65a112c3.zip busybox-f5b9a2267803bcb1dad5e902dcdfeefb65a112c3.tar.gz |
ip: fix crash in "ip neigh show"
parse_rtattr() was using tb[] array without initializing it.
Based on patch by Balaji Punnuru <balaji_punnuru@cable.comcast.com>
function old new delta
parse_rtattr 85 107 +22
print_route 1630 1617 -13
print_linkinfo 807 794 -13
iproute_get 835 822 -13
print_rule 680 665 -15
ll_remember_index 263 248 -15
print_addrinfo 1223 1197 -26
ipaddr_list_or_flush 1253 1223 -30
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/7 up/down: 22/-125) Total: -103 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/libiproute/ipneigh.c')
-rw-r--r-- | networking/libiproute/ipneigh.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/networking/libiproute/ipneigh.c b/networking/libiproute/ipneigh.c index 1cd90d7..f572414 100644 --- a/networking/libiproute/ipneigh.c +++ b/networking/libiproute/ipneigh.c @@ -110,11 +110,13 @@ static int FAST_FUNC print_neigh(const struct sockaddr_nl *who UNUSED_PARAM, return 0; if (G_filter.index && G_filter.index != r->ndm_ifindex) return 0; - if (!(G_filter.state&r->ndm_state) && - !(r->ndm_flags & NTF_PROXY) && - (r->ndm_state || !(G_filter.state & 0x100)) && - (r->ndm_family != AF_DECnet)) + if (!(G_filter.state&r->ndm_state) + && !(r->ndm_flags & NTF_PROXY) + && (r->ndm_state || !(G_filter.state & 0x100)) + && (r->ndm_family != AF_DECnet) + ) { return 0; + } parse_rtattr(tb, NDA_MAX, NDA_RTA(r), n->nlmsg_len - NLMSG_LENGTH(sizeof(*r))); |