Quagga, since version 0.99.3, takes metric value from RTM_NEWADDR
message received from routing socket and this value overrides
right interface metric learned by quagga at startup time.
FreeBSD always returns zero value here (even if one have used
'ifconfig if0 metric N' and quagga does not sanitize it.
Then quagga passes zero interface metric to ripd
that uses it as hop count increment value (if one does not use
'offset-list in' for interface) thus breaking RIP.
Fix: This patch adds needed sanity check. 'If' statement added
is always false for all versions of FreeBSD but may become true
one day if RTM_NEWADDR would return interface metric
set with ifconfig(1).
Content-Type: text/plain; name="file.diff"
Content-Disposition: attachment; filename="file.diff"
--- zebra/kernel_socket.c.orig Fri Jan 26 10:55:03 2007
+++ zebra/kernel_socket.c Fri Jan 26 10:55:35 2007
@@ -585,6 +585,7 @@
if (ifnlen && strncmp (ifp->name, ifname, INTERFACE_NAMSIZ))
isalias = 1;
+ if (ifam->ifam_metric)
ifp->metric = ifam->ifam_metric;
/* Add connected address. */
How-To-Repeat: Run quagga/ripd, make ripd obtain a route from network and
see that it does not increase its metric when advertizes the route
later. Versions 0.99.2 (and earlier) do not behave so.
Awaiting maintainers feedback
Can't contact submitter directly (troubles with his mail relays).
So, Eugene, have You read Bruce M. Simpsons message? May You explain why
your "if" is better way then "#ifdef"? May we guarantee that
ifam->ifam_metric will always be zero until freebsd developers will set
it to the reasonable value?
I've read Bruce's answer. I think both variants are acceptable
but run time check makes it possible to build a package
that would run correctly and without recompilaton
for current kernel and for future kernel that would return right
interface metric through routing socket.
I've get detailed explanation from Eugen and agreed. Patch is approved.
Feedback received. Maintainer approved.
sem 2007-02-01 13:25:05 UTC
FreeBSD ports repository
- Add a sanity check when ripd takes metric from RTM_NEWADDR message.
- Bump PORTREVISION.
Submitted by: Eugene Grosbein <eugen_AT_grosbein.pp.ru>
Approved by: maintainer
Revision Changes Path
1.49 +1 -0 ports/net/quagga/Makefile
1.1 +12 -0 ports/net/quagga/files/patch-zebra-kernel_socket.c (new)
email@example.com mailing list
To unsubscribe, send any mail to "firstname.lastname@example.org"