diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-11 01:04:15 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-11 01:04:15 +0100 |
commit | c99050cce228b214c2856c6eebefbefffccade7f (patch) | |
tree | 59813a1bb1828760922486a73c41bc15293f2a4e /sysdep/linux/netlink.c | |
parent | cf3e3845c205dacf2720cdb76a9a004a816d2e6f (diff) |
KRT: Fix bug in multipath handling
Diffstat (limited to 'sysdep/linux/netlink.c')
-rw-r--r-- | sysdep/linux/netlink.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index afb9dc8b..76ffe78b 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -677,8 +677,10 @@ nl_parse_multipath(struct krt_proto *p, struct rtattr *ra, int af) nh_buf_size = nh_buf_size ? (nh_buf_size * 2) : 4; nh_buffer = xrealloc(nh_buffer, nh_buf_size * NEXTHOP_MAX_SIZE); } - *last = rv = nh_buffer + nh_buf_used++; - rv->next = NULL; + /* FIXME: This is really ugly */ + *last = rv = (void *) (((byte *) nh_buffer) + (nh_buf_used++ * NEXTHOP_MAX_SIZE)); + memset(rv, 0, NEXTHOP_MAX_SIZE); + // rv->next = NULL; last = &(rv->next); rv->flags = 0; |