Bug 108430 - [patch] RIP is broken in net/quagga
Summary: [patch] RIP is broken in net/quagga
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergey Matveychuk
Depends on:
Reported: 2007-01-27 15:10 UTC by Eugene Grosbein
Modified: 2007-02-01 13:30 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein 2007-01-27 15:10:17 UTC
	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.
Comment 1 Edwin Groothuis freebsd_committer 2007-01-29 23:24:52 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Boris Kovalenko 2007-01-30 05:25:22 UTC

    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,
Comment 3 Eugene Grosbein 2007-01-31 14:35:29 UTC

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.

Comment 4 Boris Kovalenko 2007-02-01 03:09:15 UTC

    I've get detailed explanation from Eugen and agreed. Patch is approved.

With respect,
Comment 5 Sergey Matveychuk freebsd_committer 2007-02-01 13:04:39 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sem

Take it.
Comment 6 Sergey Matveychuk freebsd_committer 2007-02-01 13:06:52 UTC
State Changed
From-To: feedback->open

Feedback received. Maintainer approved.
Comment 7 dfilter service freebsd_committer 2007-02-01 13:25:29 UTC
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 
  - Add a sanity check when ripd takes metric from RTM_NEWADDR message.
  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
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 8 Sergey Matveychuk freebsd_committer 2007-02-01 13:25:54 UTC
State Changed
From-To: open->closed

Committed. Thanks!