[quagga-dev 7788] IPv6 Multicast Hop Limit for OSPFv3

Mike Pontillo pontillo at gmail.com
Tue Feb 9 23:58:55 GMT 2010

Hi all,

   Today I was doing some interoperability testing between a
proprietary OSPFv3 implementation and Quagga.

   The proprietary implementation enforces the old OSPFv2 MUST
requirement that OSPF multicast packets need to be sent with a TTL of
1. That is, if it receives an OSPFv3 packet with a hop limit set to
something other than 1, it rejects the packet.

   Now, there is a "should" in RFC 5340 that suggests, but does not
require setting the hop limit to 1. From
http://tools.ietf.org/html/rfc5340#appendix-A.1 -


   o  Use of IPv6 multicast.  Some OSPF messages are multicast when sent
      over broadcast networks.  Two distinct IP multicast addresses are
      used.  Packets sent to these multicast addresses should never be
      forwarded; they are meant to travel a single hop only.  As such,
      the multicast addresses have been chosen with link-local scope and
      packets sent to these addresses should have their IPv6 Hop Limit
      set to 1.

   Based on this "should", I wrote up a quick patch that would set the
hop limit to 1 for multicast packets sent on the OSPFv3 socket. (see
attachment) I wasn't sure if it really needed to be #ifdef'd, since it
should work on any RFC 3493 compliant system, and I'm guessing any
systems that don't support that probably won't be compiling OSPFv3
anyway. But I followed the pattern of the existing checksum disable

   Is this something worth fixing in Quagga? (I already plan to nag
about getting the proprietary implementation fixed.)

-------------- next part --------------
diff -urNad quagga-0.99.13~/ospf6d/ospf6_network.c quagga-0.99.13/ospf6d/ospf6_network.c
--- quagga-0.99.13~/ospf6d/ospf6_network.c      2009-05-08 08:46:43.000000000 -0700
+++ quagga-0.99.13/ospf6d/ospf6_network.c       2010-02-09 14:49:05.000000000 -0800
@@ -76,6 +76,19 @@

+ospf6_set_hop_limit (void)
+  int hop_limit = 1;
+  if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
+                  &hop_limit, sizeof (hop_limit)) < 0)
+    zlog_warn ("Network: set ospf6 hop limit failed: %s", safe_strerror (errno));
+  zlog_warn ("Network: Not setting ospf6 hop limit to 1");
 /* Make ospf6d's server socket. */
 ospf6_serv_sock (void)
@@ -103,6 +116,7 @@
   ospf6_reset_mcastloop ();
   ospf6_set_pktinfo ();
   ospf6_set_checksum ();
+  ospf6_set_hop_limit ();

   /* setup global in6_addr, allspf6 and alldr6 for later use */
   inet_pton (AF_INET6, ALLSPFROUTERS6, &allspfrouters6);

More information about the Quagga-dev mailing list