diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-03-29 15:55:39 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-03-29 15:55:39 +0200 |
commit | ed6100441ec6e95797d3692925b85c627a4e8df1 (patch) | |
tree | 305a90c23b4433a9b8f817080ab169168c7b6217 /sysdep | |
parent | 6fe11c994151344c38d1b080c3f2e1280b4b2448 (diff) |
Netlink: Better handling of an error case
Diffstat (limited to 'sysdep')
-rw-r--r-- | sysdep/linux/netlink.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index 897c3c6c..654dc4d1 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -1419,13 +1419,13 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) if (!nl_parse_attrs(RTM_RTA(i), rtm_attr_want_mpls, a, sizeof(a))) return; - if (a[RTA_DST]) - if (rta_get_mpls(a[RTA_DST], rta_mpls_stack) == 1) - net_fill_mpls(&dst, rta_mpls_stack[0]); - else - log(L_WARN "KRT: Got multi-label MPLS RTA_DST"); - else - return; /* No support for MPLS routes without RTA_DST */ + if (!a[RTA_DST]) + SKIP("MPLS route without RTA_DST"); + + if (rta_get_mpls(a[RTA_DST], rta_mpls_stack) != 1) + SKIP("MPLS route with multi-label RTA_DST"); + + net_fill_mpls(&dst, rta_mpls_stack[0]); break; default: |