bin/111493: routed doesn't use multicasts for RIPv2 via P2P
interfaces
Vernon Schryver
vjs at calcite.rhyolite.com
Sat Jul 21 14:10:05 UTC 2007
The following reply was made to PR bin/111493; it has been noted by GNATS.
From: Vernon Schryver <vjs at calcite.rhyolite.com>
To: dan at obluda.cz, freebsd-gnats-submit at FreeBSD.org
Cc: bms at incunabulum.net, carlson at workingcode.com
Subject: Re: bin/111493: routed doesn't use multicasts for RIPv2 via P2P interfaces
Date: Sat, 21 Jul 2007 13:45:45 GMT
I'm sending a copy of this to James Carlson, who knows a lot about the
`routed` code.
The description in
http://www.freebsd.org/cgi/query-pr.cgi?pr=111493
says:
RIPv2 should use multicasts when possible. Current code test
IFF_MULTICAST on IFF_BROADCAST interfaces only. It doesn't use
multicast on non-broadcast interfaces even they are multicast
capable.
If an interface is point-to-point (it sets the IFF_POINTOPOINT bit),
is it right to send to the RIPv2 multicast address?
Even on a GRE tunnel, why isn't it better to unicast to the router at
the other end of the tunnel instead of multicasting?
I have the impression that GRE tunnels are utterly wierd--is the
remote IP address of the GRE interface not that of the remote router?
I also wonder if the proposed patch does what it is intended to do.
Consider the error of the missing () in the first change:
@@ -140,7 +140,7 @@
flags = MSG_DONTROUTE;
break;
case OUT_MULTICAST:
- if (ifp->int_if_flags & IFF_POINTOPOINT) {
+ if (ifp->int_if_flags & IFF_POINTOPOINT && ! ifp->int_if_flags & IFF_MULTICAST) {
msg = "Send pt-to-pt";
C precedence rules require that expression be parsed as
(!ifp->int_if_flags) & IFF_MULTICAST
ifp->int_if_flags never 0,
and so (!ifp->int_if_flags) is always 0
and so ((!ifp->int_if_flags) & IFF_MULTICAST) is always 0
and so the first alternative will never be taken even for ordinary, non-GRE
point-to-point interfaces.
I would be happier about the proposed change (with the () error
fixed) if there were a test case or at least a description of the
failure with the current code.
Vernon Schryver vjs at rhyolite.com
More information about the freebsd-bugs
mailing list