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). Eugene Grosbein--8l6dX3vWQAA4Bkb4XKHEO0Te1HQbDuBC9VWrzHM0FDKO0Bjy Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit 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.
State Changed From-To: open->feedback Awaiting maintainers feedback
Hello! 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? With respect, Boris
Hi! 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. Eugene
Hello! I've get detailed explanation from Eugen and agreed. Patch is approved. With respect, Boris
Responsible Changed From-To: freebsd-ports-bugs->sem Take it.
State Changed From-To: feedback->open Feedback received. Maintainer approved.
sem 2007-02-01 13:25:05 UTC FreeBSD ports repository Modified files: net/quagga Makefile Added files: net/quagga/files patch-zebra-kernel_socket.c Log: - Add a sanity check when ripd takes metric from RTM_NEWADDR message. - Bump PORTREVISION. PR: ports/108430 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) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!