[PATCH] babel: Log the reason when refusing to run on an interface
Ondrej Zajicek
santiago at crfreenet.org
Mon May 10 20:28:22 CEST 2021
On Tue, Apr 20, 2021 at 12:27:05AM +0200, Toke Høiland-Jørgensen wrote:
> The babel protocol code checks various properties of an interface before
> starting it: whether the interface is up, whether it supports multicast,
> and whether it has a link-local address assigned. However, it doesn't give
> any feedback if any of those checks fail, it just silently ignores the
> interface.
>
> Fix this by explicitly logging errors when any of the checks fail; to avoid
> spamming the logs for all interfaces on the system, move the checks so they
> are only performed after it was determined that an interface is actually
> configured by an interface pattern.
Hi
Merged with some rework.
> +static int iface_is_valid(struct babel_proto *p, struct iface *iface)
> +{
> + if (!(iface->flags & IF_UP)) {
> + log(L_ERR "%s: Interface '%s' is down", p->p.name, iface->name);
> + return 0;
> + }
This should be silent. Interface down is valid administrative condition.
> + if (!(iface->flags & IF_MULTICAST)) {
> + log(L_ERR "%s: Interface '%s' does not support multicast",
> + p->p.name, iface->name);
> + return 0;
> + }
This is OK
> + /* We need a link-local address to communicate */
> + if (!iface->llv6) {
> + log(L_ERR "%s: Interface '%s' has no link-local address assigned",
> + p->p.name, iface->name);
> + return 0;
> + }
This is complicated. At first it makes sense, but if i remember correctly
there is a transient condition where immediately after iface goes up, OS
does DAD on the address, during which it is unassigned, and after end of
DAD it will appear. Therefore for each new iface, there would be this error
message in log and then perfectly working iface. So it is probably better
to keep it also silent.
--
Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
More information about the Bird-users
mailing list