bin/111493: routed doesn't use multicasts for RIPv2 via P2P interfaces

Vernon Schryver vjs at
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>
To: dan at, freebsd-gnats-submit at
Cc: bms at, carlson at
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
     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
 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;
          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

More information about the freebsd-bugs mailing list