summaryrefslogtreecommitdiffstats
path: root/lib/prefix.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: prefix unionizationDavid Lamparter2022-04-271-9/+21
| | | | | | | Ahead of May 1st, the workers of the prefix have decided on more unionization. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib, bgpd: changes for EAD-per-ES fragmentationAnuradha Karuppiah2022-03-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EAD-per-ES route carries ECs for all the ES-EVI RTs. As the number of VNIs increase all RTs do not fit into a standard BGP UPDATE (4K) so the route needs to be fragmented. Each fragment is associated with a separate RD and frag-id - 1. Local ES-per-EAD - ES route table - {ES-frag-ID, ESI, ET=0xffffffff, VTEP-IP} global route table - {RD-=ES-frag-RD, ESI, ET=0xffffffff} 2. Remote ES-per-EAD - VNI route table - {ESI, ET=0xffffffff, VTEP-IP} global route table - {RD-=ES-frag-RD, ESI, ET=0xffffffff} Note: The fragment ID is abandoned in the per-VNI routing table. At this point that is acceptable as we dont expect more than one-ES-per-EAD fragment to be imported into the per-VNI routing table. But that may need to be re-worked at a later point. CLI changes (sample with 4 VNIs per-fragment for experimental pruposes) - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> root@torm-11:mgmt:~# vtysh -c "show bgp l2vpn evpn es 03:44:38:39:ff:ff:01:00:00:01" ESI: 03:44:38:39:ff:ff:01:00:00:01 Type: LR RD: 27.0.0.21:3 Originator-IP: 27.0.0.21 Local ES DF preference: 50000 VNI Count: 10 Remote VNI Count: 10 VRF Count: 3 MACIP EVI Path Count: 33 MACIP Global Path Count: 198 Inconsistent VNI VTEP Count: 0 Inconsistencies: - Fragments: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 27.0.0.21:3 EVIs: 4 27.0.0.21:13 EVIs: 4 27.0.0.21:22 EVIs: 2 VTEPs: 27.0.0.22 flags: EA df_alg: preference df_pref: 32767 27.0.0.23 flags: EA df_alg: preference df_pref: 32767 root@torm-11:mgmt:~# vtysh -c "show bgp l2vpn evpn es-evi vni 1002 detail" VNI: 1002 ESI: 03:44:38:39:ff:ff:01:00:00:01 Type: LR ES fragment RD: 27.0.0.21:13 >>>>>>>>>>>>>>>>>>>>>>>>> Inconsistencies: - VTEPs: 27.0.0.22(EV),27.0.0.23(EV) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PS: The number of EVIs per-fragment has been set to 128 and may need further tuning. Ticket: #2632967 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
* lib: add `%pFXh` to print prefix w/o prefixlenDavid Lamparter2022-03-111-3/+34
| | | | | | Mostly for pimd, for the time being. May be removed again if unused. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use semicolon after printfrr_ext_autoreg_{p,d}David Lamparter2022-01-141-6/+6
| | | | | | Mostly to make clang-format not format these to peak ugly. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: add `s` option to `pI4`/`pI6`/`pIA` printfrrDavid Lamparter2022-01-141-0/+46
| | | | | | | | Adding an `s` after these printfrr specifiers replaces 0.0.0.0 / :: in the output with a star (`*`). This is primarily intended for use with multicast, e.g. to print `(*,G)`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: move `%pSG4` to `%pPSG4`David Lamparter2022-01-121-1/+1
| | | | | | | Since this is only used in very few places, moving it out of the way is reasonable. (`%pSG` will be pim_sgaddr) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: fix spelling nits in more lib filesewlumpkin2021-10-051-1/+1
| | | | Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
* Merge pull request #8942 from ton31337/fix/cleanups_2Donald Sharp2021-07-061-1/+2
|\ | | | | Another round of cleanup
| * lib: Avoid using assignments within checksDonatas Abraitis2021-06-291-1/+2
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | *: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLENDonatas Abraitis2021-07-011-8/+9
|/ | | | | | Just drop IPV4_MAX_PREFIXLEN at all, no need keeping both. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #8376 from mjstapp/fix_remove_inet6_ntoaDonald Sharp2021-04-021-9/+0
|\ | | | | lib, ripngd: Remove inet6_ntoa
| * lib: remove inet6_ntoa apiMark Stapp2021-03-311-9/+0
| | | | | | | | | | | | Remove inet6_ntoa() - used static buffer, not needed. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* | lib: put printfrr extension args into structDavid Lamparter2021-03-301-12/+12
| | | | | | | | | | | | ... for easier extensibility. Add width, # and - flags while at it. Signed-off-by: David Lamparter <equinox@diac24.net>
* | lib: print `(null)` rather than `NULL`David Lamparter2021-03-271-6/+6
| | | | | | | | | | | | ... for consistency with `%s`, which also prints `(null)`. Signed-off-by: David Lamparter <equinox@diac24.net>
* | lib: rework printfrr extensions to output directlyDavid Lamparter2021-03-271-47/+47
|/ | | | | | | | | | | | | | | Allowing printfrr extensions to directly write to the output buffer has a few advantages: - there is no arbitrary length limit imposed (previously 64) - the output doesn't need to be copied another time - the extension can directly use bprintfrr() to put together pieces The downside is that the theoretical length (regardless of available buffer space) must be computed correctly. Extended unit tests to test these paths a bit more thoroughly. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: require semicolon after DEFINE_MTYPE & coDavid Lamparter2021-03-171-2/+2
| | | | | | | | | | | | | | | | | Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: protect printfrr extensions from NULL inputMark Stapp2021-03-011-14/+40
| | | | | | Protect the lib printfrr extension handlers from NULL inputs. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: remove more sprintf()Quentin Young2021-02-091-2/+2
| | | | | | | Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
* bgpd: support for DF election in EVPN-MHAnuradha Karuppiah2020-10-261-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DF (Designated forwarder) election is used for picking a single BUM-traffic forwarded per-ES. RFC7432 specifies a mechanism called service carving for DF election. However that mechanism has many disadvantages - 1. LBs poorly. 2. Doesn't allow for a controlled failover needed in upgrade scenarios. 3. Not easy to hw accelerate. To fix the poor performance of service carving alternate DF mechanisms have been proposed via the following drafts - draft-ietf-bess-evpn-df-election-framework draft-ietf-bess-evpn-pref-df This commit adds support for the pref-df election mechanism which is used as the default. Other mechanisms including service-carving may be added later. In this mechanism one switch on an ES is elected as DF based on the preference value; higher preference wins with IP address acting as the tie-breaker (lower-IP wins if pref value is the same). Sample output ============= >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> torm-11# sh bgp l2vpn evpn es 03:00:00:00:00:01:11:00:00:01 ESI: 03:00:00:00:00:01:11:00:00:01 Type: LR RD: 27.0.0.15:6 Originator-IP: 27.0.0.15 Local ES DF preference: 100 VNI Count: 10 Remote VNI Count: 10 Inconsistent VNI VTEP Count: 0 Inconsistencies: - VTEPs: 27.0.0.16 flags: EA df_alg: preference df_pref: 32767 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> torm-11# sh bgp l2vpn evpn route esi 03:00:00:00:00:01:11:00:00:01 *> [4]:[03:00:00:00:00:01:11:00:00:01]:[32]:[27.0.0.15] 27.0.0.15 32768 i ET:8 ES-Import-Rt:00:00:00:00:01:11 DF: (alg: 2, pref: 100) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
* bgpd: replace bgp_evpn_route2str with prefix2strPat Ruddy2020-10-161-12/+25
| | | | | | Remove bgp_evpn_route2str and replace calls with prefix2str Signed-off-by: Pat Ruddy <pat@voltanet.io>
* lib: align prefixevpn2str output with bgp_evpn_route2strPat Ruddy2020-10-151-49/+42
| | | | | | | | We have 2 different routines to turn an evpn route into a string. This commit aligns the two to the latest maintained version as a first step in removing one of them. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* lib: add family attribute for flowspec prefix structurePhilippe Guibert2020-08-211-0/+13
| | | | | | | | | | to recognize whether a flowspec prefix has been carried out by ipv4 flowspec or ipv6 flowspec ( actually, the hypothesis is that only ipv4 flowspec is supported), then a new attribute should contain the family value: AF_INET or AF_INET6. That value will be further used in the BGP flowspec code. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* lib: add %pEA for struct ethaddr *David Lamparter2020-07-141-0/+10
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: add %pIA for struct ipaddr *David Lamparter2020-07-141-0/+11
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: clarify usage of prefix_bit functionQuentin Young2020-06-221-3/+3
| | | | | | "prefixlen" is really a bit index Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: Minor update to EVPN type-5 prefix displayvivek2020-05-261-1/+1
| | | | Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* *: Replace `sizeof something` to sizeof(something)Donatas Abraitis2020-03-081-1/+1
| | | | | | Satisfy checkpatch.pl requirements (check for sizeof without parenthesis) Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #5806 from ton31337/fix/remove_break_after_returnMark Stapp2020-02-131-3/+0
|\ | | | | *: Remove break after return
| * *: Remove break after returnDonatas Abraitis2020-02-131-3/+0
| | | | | | | | | | | | Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | bgpd: RFC compliance wrt invalid RMAC, GWIP, ESI and VNIKishore Aramalla2020-02-111-0/+19
|/ | | | | | | | | | | | | | | | | | A route where ESI, GW IP, MAC and Label are all zero at the same time SHOULD be treat-as-withdraw. Invalid MAC addresses are broadcast or multicast MAC addresses. The route MUST be treat-as-withdraw in case of an invalid MAC address. As FRR support Ethernet NVO Tunnels only. Route will be withdrawn when ESI, GW IP and MAC are zero or Invalid MAC Test cases: 1) ET-5 route with valid RMAC extended community 2) ET-5 route no RMAC extended community 3) ET-5 route with Multicast MAC in RMAC extended community 4) ET-5 route with Broadcast MAC in RMAC extended community Signed-off-by: Kishore Aramalla <karamalla@vmware.com>
* *: Replace s_addr 0 => INADDR_ANYDonatas Abraitis2020-02-061-2/+2
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: don't null after XFREE; XFREE does this itselfQuentin Young2020-02-031-1/+0
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #4773 from thozza/31-prefix-bcast-addrRuss White2020-01-281-5/+5
|\ | | | | ipv4_broadcast_addr() didn't comply with RFC3021
| * lib/prefix.c: ipv4_broadcast_addr() didn't comply with RFC3021Tomas Hozza2019-08-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function ipv4_broadcast_addr() does not calculate correct broadcast addresses for point-to-point connections with prefix 31. RFC3021 section 3.3 [1] specifies: "The 255.255.255.255 IP broadcast address MUST be used for broadcast Address Mask Replies in point-to-point links with 31-bit subnet masks" The issue causes Zebra to print the following warning when IPv4 address with 31 prefix (e.g. 192.168.222.240/31) is configured on a network interface: ZEBRA: [EC 4043309141] warning: interface VNS broadcast addr 255.255.255.255/31 != calculated 192.168.222.241, routing protocols may malfunction The issue has been originally found in Quagga [2], but it is present also in FRR. [1] https://tools.ietf.org/html/rfc3021#section-3.3 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1713449 Signed-off-by: Tomas Hozza <thozza@redhat.com>
* | lib/prefix: flip the bitrot compostDavid Lamparter2019-12-141-457/+35
| | | | | | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* | *: Convert prefix_free to double pointerDonald Sharp2019-11-021-6/+14
| | | | | | | | | | | | Have the prefix_free code take a double pointer to free the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #4850 from lkrishnamoor/show_cliRuss White2019-10-191-0/+47
|\ \ | | | | | | bgpd: Adding new bgp evpn cli's for ip-prefix lookup
| * | bgpd: Adding new bgp evpn cli's for ip-prefix lookupLakshman Krishnamoorthy2019-09-271-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement CLIs for the following, to filter for a prefix within evpn type 5 route 1) show bgp l2vpn evpn A.B.C.D 2) show bgp l2vpn evpn A.B.C.D json 3) show bgp l2vpn evpn A.B.C.D/M 4) show bgp l2vpn evpn A.B.C.D/M json 5) show bgp l2vpn evpn X:X::X:X 6) show bgp l2vpn evpn X:X::X:X json 7) show bgp l2vpn evpn X:X::X:X/M 8) show bgp l2vpn evpn X:X::X:X/M json Sample output provided here: https://github.com/FRRouting/frr/pull/4850 Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
* | | lib: Fix read beyond end of data structureDonald Sharp2019-10-101-2/+12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our Address Sanitizer CI is finding this issue: error 09-Oct-2019 19:28:33 r4: bgpd triggered an exception by AddressSanitizer error 09-Oct-2019 19:28:33 ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdd425b060 at pc 0x00000068575f bp 0x7ffdd4258550 sp 0x7ffdd4258540 error 09-Oct-2019 19:28:33 READ of size 1 at 0x7ffdd425b060 thread T0 error 09-Oct-2019 19:28:33 #0 0x68575e in prefix_cmp lib/prefix.c:776 error 09-Oct-2019 19:28:33 #1 0x5889f5 in rfapiItBiIndexSearch bgpd/rfapi/rfapi_import.c:2230 error 09-Oct-2019 19:28:33 #2 0x5889f5 in rfapiBgpInfoFilteredImportVPN bgpd/rfapi/rfapi_import.c:3520 error 09-Oct-2019 19:28:33 #3 0x58b909 in rfapiProcessWithdraw bgpd/rfapi/rfapi_import.c:4071 error 09-Oct-2019 19:28:33 #4 0x4c459b in bgp_withdraw bgpd/bgp_route.c:3736 error 09-Oct-2019 19:28:33 #5 0x484122 in bgp_nlri_parse_vpn bgpd/bgp_mplsvpn.c:237 error 09-Oct-2019 19:28:33 #6 0x497f52 in bgp_nlri_parse bgpd/bgp_packet.c:315 error 09-Oct-2019 19:28:33 #7 0x49d06d in bgp_update_receive bgpd/bgp_packet.c:1598 error 09-Oct-2019 19:28:33 #8 0x49d06d in bgp_process_packet bgpd/bgp_packet.c:2274 error 09-Oct-2019 19:28:33 #9 0x6b9f54 in thread_call lib/thread.c:1531 error 09-Oct-2019 19:28:33 #10 0x657037 in frr_run lib/libfrr.c:1052 error 09-Oct-2019 19:28:33 #11 0x42d268 in main bgpd/bgp_main.c:486 error 09-Oct-2019 19:28:33 #12 0x7f806032482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) error 09-Oct-2019 19:28:33 #13 0x42bcc8 in _start (/usr/lib/frr/bgpd+0x42bcc8) error 09-Oct-2019 19:28:33 error 09-Oct-2019 19:28:33 Address 0x7ffdd425b060 is located in stack of thread T0 at offset 240 in frame error 09-Oct-2019 19:28:33 #0 0x483945 in bgp_nlri_parse_vpn bgpd/bgp_mplsvpn.c:103 error 09-Oct-2019 19:28:33 error 09-Oct-2019 19:28:33 This frame has 5 object(s): error 09-Oct-2019 19:28:33 [32, 36) 'label' error 09-Oct-2019 19:28:33 [96, 108) 'rd_as' error 09-Oct-2019 19:28:33 [160, 172) 'rd_ip' error 09-Oct-2019 19:28:33 [224, 240) 'prd' <== Memory access at offset 240 overflows this variable error 09-Oct-2019 19:28:33 [288, 336) 'p' error 09-Oct-2019 19:28:33 HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext error 09-Oct-2019 19:28:33 (longjmp and C++ exceptions *are* supported) error 09-Oct-2019 19:28:33 SUMMARY: AddressSanitizer: stack-buffer-overflow lib/prefix.c:776 prefix_cmp error 09-Oct-2019 19:28:33 Shadow bytes around the buggy address: error 09-Oct-2019 19:28:33 0x10003a8435b0: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 error 09-Oct-2019 19:28:33 0x10003a8435c0: 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 f3 error 09-Oct-2019 19:28:33 0x10003a8435d0: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 error 09-Oct-2019 19:28:33 0x10003a8435e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 error 09-Oct-2019 19:28:33 0x10003a8435f0: f1 f1 04 f4 f4 f4 f2 f2 f2 f2 00 04 f4 f4 f2 f2 error 09-Oct-2019 19:28:33 =>0x10003a843600: f2 f2 00 04 f4 f4 f2 f2 f2 f2 00 00[f4]f4 f2 f2 error 09-Oct-2019 19:28:33 0x10003a843610: f2 f2 00 00 00 00 00 00 f4 f4 f3 f3 f3 f3 00 00 error 09-Oct-2019 19:28:33 0x10003a843620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 error 09-Oct-2019 19:28:33 0x10003a843630: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 02 f4 error 09-Oct-2019 19:28:33 0x10003a843640: f4 f4 f2 f2 f2 f2 04 f4 f4 f4 f2 f2 f2 f2 00 00 error 09-Oct-2019 19:28:33 0x10003a843650: f4 f4 f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 error 09-Oct-2019 19:28:33 Shadow byte legend (one shadow byte represents 8 application bytes): error 09-Oct-2019 19:28:33 Addressable: 00 error 09-Oct-2019 19:28:33 Partially addressable: 01 02 03 04 05 06 07 error 09-Oct-2019 19:28:33 Heap left redzone: fa error 09-Oct-2019 19:28:33 Heap right redzone: fb error 09-Oct-2019 19:28:33 Freed heap region: fd error 09-Oct-2019 19:28:33 Stack left redzone: f1 error 09-Oct-2019 19:28:33 Stack mid redzone: f2 error 09-Oct-2019 19:28:33 Stack right redzone: f3 error 09-Oct-2019 19:28:33 Stack partial redzone: f4 error 09-Oct-2019 19:28:33 Stack after return: f5 error 09-Oct-2019 19:28:33 Stack use after scope: f8 error 09-Oct-2019 19:28:33 Global redzone: f9 error 09-Oct-2019 19:28:33 Global init order: f6 error 09-Oct-2019 19:28:33 Poisoned by user: f7 error 09-Oct-2019 19:28:33 Container overflow: fc error 09-Oct-2019 19:28:33 Array cookie: ac error 09-Oct-2019 19:28:33 Intra object redzone: bb error 09-Oct-2019 19:28:33 ASan internal: fe error 09-Oct-2019 19:28:36 r3: Daemon bgpd not running This is the result of this code pattern in rfapi/rfapi_import.c: prefix_cmp((struct prefix *)&bpi_result->extra->vnc.import.rd, (struct prefix *)prd)) Effectively prd or vnc.import.rd are `struct prefix_rd` which are being typecast to a `struct prefix`. Not a big deal except commit 1315d74de97be2944d7b005b2f9a50e9ae5eff4d modified the prefix_cmp function to allow for a sorted prefix_cmp. In prefix_cmp we were looking at the offset and shift. In the case of vnc we were passing a prefix length of 64 which is the exact length of the remaining data structure for struct prefix_rd. So we calculated a offset of 8 and a shift of 0. The data structures for the prefix portion happened to be equal to 64 bits of data. So we checked that with the memcmp got a 0 and promptly read off the end of the data structure for the numcmp. The fix is if shift is 0 that means thei the memcmp has checked everything and there is nothing to do. Please note: We will still crash if we set the prefixlen > then ~312 bits currently( ie if the prefixlen specifies a bit length longer than the prefix length ). I do not think there is anything to do here( nor am I sure how to correct this either ) as that we are going to have some severe problems when we muck up the prefixlen. Fixes: #5025 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #4877 from mjstapp/dplane_neighsDonald Sharp2019-09-041-1/+1
|\ \ | | | | | | zebra: move evpn neighbors to dataplane
| * | lib: use const in prefix_mac2strMark Stapp2019-08-231-1/+1
| |/ | | | | | | | | | | Use const for mac pointer. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* | lib: fix a couple more doc commentsRenato Westphal2019-08-211-2/+2
| | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | lib: switch str2prefix_ipv4() to use inet_pton()Renato Westphal2019-08-211-1/+3
|/ | | | | | | This is the second part of commit 8d92004979dc68, which converted only one of the two calls to inet_aton(). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: fix prefix_copy() for clang-SADavid Lamparter2019-07-291-0/+4
| | | | | | https://bugs.llvm.org/show_bug.cgi?id=42811 Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: use some more transparent unions for prefixesDavid Lamparter2019-07-281-3/+11
| | | | | | ... so we can pass prefix_ipv4/prefix_ipv6 in. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: fix prefix_cmp() return valuesDavid Lamparter2019-07-281-16/+16
| | | | | | OMGWTFBBQ Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: remove snprintf from prefix2strQuentin Young2019-06-131-5/+21
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: add some printfrr specifiersDavid Lamparter2019-06-031-0/+46
| | | | | | More to come - these are just the most obvious and easy. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: remove some strcpy, strcatQuentin Young2019-05-291-1/+1
| | | | | | Replace with strlcpy, strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: Make prefix_hash_key accept a constDonald Sharp2019-05-021-1/+1
| | | | | | | We should not be modifying the pointer for the prefix_hash_key function, make it a const so that we can use it elsewhere. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>