a local logger masks the global logger and prevents errors from being
gracefully handled within topotest.py
Signed-off-by: Liam Brady <lbrady@labn.net>
The frrevent system is spitting out this message in bgpd:
20:40:15 mem1-roc-f2-b1-r5-t2-d4 bgpd[13166]: [XETTR-D5MR0][EC 100663316] Attempting to process an I/O event but for fd: 214(8) no thread to handle this!
This is because as each io event is processed, it is possible that a
.events is set to 0. This can leave a situation where we ask
ppoll to handle anything that happens on a fd with a .events of 0,
in this situation ppoll can return POLLERR, which indicates that
something bad has happened on the fd.
Let's set the ppoll fds.fd value to -1 when there are no more
events to be processed. ppoll specifically calls out that
it will just skip this particular one.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Move the various destinations handling into lib/memory.c, include
"normal" logging as target, and make `ACTIVEATEXIT` properly non-error
as it was intended to be.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
`log_memstats()` is not AS-safe. It can hang the crash handler (or set
your PC on fire, or cause the sun to go supernova - according to POSIX
specs, anyway.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
No `zlog_fini()`, please. Getting log messages until the end is more
important than leaking memory allocated for zlog targets.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Well, this was only checked for exit status, which we didn't really
observe... so, uh, yeah, not particularly noticeable it wasn't even
wired up...
clang-format off/on added to not get formatting wrecked on this.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
In the processing of nssa, if the number of areas that need to be translated is greater than 0, then abr will be regarded as asbr, and it will be marked (0x3) in the flag of router lsa. When a certain area is set from nssa to a normal area, the areas that need to be translated may be reduced. The asbr should be re-interpreted as abr when the translated area is 0.
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
Add a new topotest for getting the aigp from the "igp-metric"
for a redistributed route (ospf route in the test).
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
Fix several issues in sourcing AIGP attribute:
1) AIGP should not be set as default for a redistributed route or a
static network. It should be set by config instead.
2) AIGP sourced by "set aigp-metric igp-metric" in a route-map does
not set the correct value for a redistributed route.
3) When redistribute a connected route like loopback, the AGIP (with
value 0) is sourced by "set aigp-metric igp-metric", but the
attribute is not propagated as the attribute flag is not set.
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
Update IS-IS fuzz test to match corrected output after change in the
display of IPv4 mapped IPv6 address.
The update was performed using wuschl [1] like this:
$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h
[1] https://pypi.org/project/wuschl/
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
`dirfd()` can theoretically return an error. Call it once and check the
result.
clang-SA: technically correct™. Ain't that the best kind of correct?
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
`errno` has its own semantics. Sometimes it is correct to write to it.
This is not one of those cases - just use a separate `nl_errno`.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
`FILE *` objects are theoretically in an invalid state if you try to use
them past their reporting EOF. Adjust the code to make it correct.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
While the logic here is perfectly fine, clang-SA doesn't understand that
the fopen() and fclose() match up with each other. Just use a separate
variable to make clang-SA happy.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
non-blocking retries are already handled in `vtysh_client_receive()`.
And by the point we're back in `vtysh_client_run()`, errno may have been
overwritten by the close() call in vtysh_client_receive().
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
If a create-config command is received, but the config is never applied,
the config will be leaked on the next create-config command. This
should theoretically never happen, but let's fix it anyway.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
If a packet doesn't have an interface, we're gonna crash 2 lines below.
An assert is a little more useful... and makes clang-SA not complain
about it.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
The `buf` pointer is being updated as the parse goes along. It's not
used after the last update, but I'd rather keep this in for consistency.
Just make a note of it being unused.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
clang-SA complains that it's only partially initialized (because it's
used with IPv4 only). The code later calls some AF-generic code,
prompting clang-SA to complain that the non-IPv4 parts are used without
being set. While this shouldn't happen, just initialize it fully.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
errno is only valid if there was an actual error. A zero return value
isn't an error, it's either EOF or an empty datagram depending on
context. Fix the logic.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
The flex-generated code is disabled for clang-SA builds already, but
that means that function prototypes are missing too. Just add dummy
function prototypes so clang-SA can process the file.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
In these cases the value assigned by the switch block is used directly
rather than returned. Mark the initial/default value as used so
clang-SA doesn't complain about it.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
clang-19's SA complains about unused initializers for this kind of
"switch (enum) { return string }" kind of code. Use direct string
return values to avoid the issue.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Our standard says when in a .h file and declaring a function all parameters
must have their variables spelled out. Let's do this for ospf_lsa.h
Modified ospf_lsa.c to also use event instead of thread, and uint8_t instead
of unsigned short.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
I got asked today what was going on in the rnh code. I
had to take time off of what I was doing and rewrap my
head around this code, since it's been a long time.
As that this question may come up again in the future
I am trying to document this better so that someone
coming behind us will be able to read this and get
a better idea of what the algorithm is attempting
to do.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Currently FRR needs to send a uint16_t value for the number
of nexthops as well it needs the ability to properly decode
all of this. Find and handle all the places that this happens.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>