diff options
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r-- | proto/bgp/packets.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index c3bd600a..0bc63c55 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -1831,13 +1831,9 @@ bgp_decode_nlri_flow4(struct bgp_parse_state *s, byte *pos, uint len, rta *a) } /* Decode dst prefix */ - ip4_addr px = IP4_NONE; + ip4_addr px = flow_read_ip4_part(data); uint pxlen = data[1]; - // FIXME: Use some generic function - 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); net_fill_flow4(n, px, pxlen, pos, flen); @@ -1923,13 +1919,9 @@ bgp_decode_nlri_flow6(struct bgp_parse_state *s, byte *pos, uint len, rta *a) } /* Decode dst prefix */ - ip6_addr px = IP6_NONE; + ip6_addr px = flow_read_ip6_part(data); uint pxlen = data[1]; - // FIXME: Use some generic function - 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); net_fill_flow6(n, px, pxlen, pos, flen); |