lib/printf: ditch reallocarrayreallocarray() is walled behind stupid feature macros on various
platforms and doesn't quite gain us much in that particular use case.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib: use printfrr for log & vtyThis makes printfrr extensions available in most of our format strings.
snprintf() is the obvious exception.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib/printf: add extension supportInspired by the Linux kernel, this allows us to do %pI4 and similar
things.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib/printf: rename & private __find_argumentsThese are internal to printf(), and symbols starting with __ are
reserved for the compiler/libc.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib/printf: disable wchar_t support... we just don't use wchar_t in FRR, no point in having this enabled.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib/printf: add %Ld/%Lu for int64_t/uint64_t[u]int64_t is the only type in the intX_t family that needs
special-casing for printf since the calling convention may differ
between 32-bit and 64-bit systems.
Adding the L specifier allows us to eschew the gnarly-looking PRIu64.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib/printf: use system printf for floatsWe're not libc, we can just fall back to snprintf() to avoid all this
low-level float mangling.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib/printf: cut down to sizeremove various FreeBSD specific bits, as well as the entirety of locale
support.
Signed-off-by: David Lamparter <equinox@diac24.net>
lib: import FreeBSD's printf... from current SVN HEAD (not that it has been touched in the past 2
years ...)
Signed-off-by: David Lamparter <equinox@diac24.net>
zebra: the route nexthop interfaces per vrf were not displayed okthe interface search done was not looking in the appropriate zns. The
display was then wrong. Update the show command with the correct zns.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tools: On shutdown no need to flush from tools/frr.in scriptZebra already flushes routes on proper shutdown if you are not
using the -K option. If you are using the -K option then you
do not want the tools/frr script to flush routes.
If zebra crashes and we restart then load up will either delete
the routes or leave them depending on the -K option.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib: crash when FRR hostname length > 80 charsAlthough the RFC states hostname length should be < 255 chars,
FRR allows infinite length technically. However, when you try
to set a hostname > 80 chars, you would immediately notice a crash.
RCA: Crash due to buffer overflow. Large buffer sprintf'd into smaller
buffer. Usage of sprintf function instead of snprintf which is safer.
Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
bgpd: Filtering received EVPN routes based on VNI does not workIssue1: When "neighbor X.X.X.X route-map RM-VNI-FILTER in" is configured under evpn address-family,
all the received routes are dropped regardless of whether the route has a matching vni or not.
Issue2: Routes with 2 labels are not filtered correctly
Issue3: Interpreting the label based on tunnel type, vxlan was not done correctly.
Vxlan label has 24 bits, whereas, MPLS label is 20 bits long
...
lib: Changes made to dependencies of a r-map do not take effect.Say, more than one sequence of a route-map uses the same named entity
in its match clause. After that entity is removed from any one of the
route-map sequences, any further changes made to that entity doesn't
dynamically take effect.
A reference counter, that allows the named entity to keep a count of
the route-maps dependent on it, has been introduced to address this issue.
Signed-off-by: Na...
lib, zebra: Ensure route encoding has enough spaceWhen you have compiled FRR with a large multipath number
then encoding large ecmp routes between zebra and the
routing daemons. There exists a theoritical size
of multipath that will cause the encoding to be larger
than the ZEBRA_MAX_PACKET_SIZ. In the cases where
we have allocated streams that will encode routes
then let's ensure that whatever size we have will
auto-fit what we say we can se...
doc: Add doc for new configure optionAdd documentation for the '--command-log-always' daemon cli
and how to use it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib: Add '--command-log-always` to all daemons startupAdd 'no log commands' cli and at the same time add a
--command-log-always to the daemon startup cli.
If --command-log-always is specified then all commands are
auto-logged and the 'no log commands' form of the command
is now ignored.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib: Fix gcc 9 warning -> error issuegcc is complaing about this with --enable-dev and --enable-werror:
In function 'nb_log_callback',
inlined from 'nb_transaction_apply_finish' at lib/northbound.c:1106:4:
lib/northbound.c:777:2: error: '%s' directive argument is null [-Werror=format-overflow=]
777 | zlog_debug(
| ^~~~~~~~~~~
778 | "northbound callback: event [%s] op [%s] xpath [%s] value [%s]",
| ~~~~~~...
lib: vtypath_default could be overwrittenThe vtypath_default variable had a possibility of being overwritten
due to size constraints. This fixes this issue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib, vtysh: make debug memstats work in vtyshAllow vtysh to send the 'debug memstats-on-exit' command
to the running daemons.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOPIntroducing a 3rd state for route_map_apply library function: RMAP_NOOP
Traditionally route map MATCH rule apis were designed to return
a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH.
(Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR).
Depending on this response, the following statemachine decided the
course of action:
Action: Apply route-map match and return the re...
pimd: new cli to configure last-member-query-count & last-member-query-intervalIntroduce new cli commands ip igmp last-member-query-count <1-7>
ip igmp last-member-query-interval <1-255> deciseconds.
Display the config in show running config and show ip igmp interface
Signed-off-by: Sarita Patra <saritap@vmware.com>