diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-10 00:55:34 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-10 00:55:34 +0100 |
commit | 7fc55925beb06059759294e0e9b7bae45465395f (patch) | |
tree | 9f1ee1b354094aab25f64892f0f5dd1afeafdd26 /proto/bgp/packets.c | |
parent | ed1d853e5147376086e25f5edae9804cf242d6e0 (diff) |
Several minor fixes
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r-- | proto/bgp/packets.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index aa69bdd6..ca942880 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -1637,8 +1637,8 @@ bgp_decode_nlri_flow4(struct bgp_parse_state *s, byte *pos, uint len, rta *a) uint pxlen = data[1]; // FIXME: Use some generic function - memcpy(&px, data, BYTES(pxlen)); - px = ip4_and(px, ip4_mkmask(pxlen)); + memcpy(&px, data+2, BYTES(pxlen)); + px = ip4_and(ip4_ntoh(px), ip4_mkmask(pxlen)); /* Prepare the flow */ net_addr *n = alloca(sizeof(struct net_addr_flow4) + flen); @@ -1729,8 +1729,8 @@ bgp_decode_nlri_flow6(struct bgp_parse_state *s, byte *pos, uint len, rta *a) uint pxlen = data[1]; // FIXME: Use some generic function - memcpy(&px, data, BYTES(pxlen)); - px = ip6_and(px, ip6_mkmask(pxlen)); + memcpy(&px, data+2, BYTES(pxlen)); + px = ip6_and(ip6_ntoh(px), ip6_mkmask(pxlen)); /* Prepare the flow */ net_addr *n = alloca(sizeof(struct net_addr_flow6) + flen); |