[Olsr-dev] mtu problem with multicast ipv6 packets

John Hay (spam-protected)
Mon Mar 23 20:23:02 CET 2009


On Mon, Mar 23, 2009 at 08:03:14PM +0100, Henning Rogge wrote:
> On Montag 23 M?rz 2009 19:46:37 you wrote:
> > > Is there a drawback to set this parameter always on ? Or did I
> > > misunderstand the patch and IPV6_USE_MIN_MTU is set by some system
> > > include file ?
> >
> > IPV6_USE_MIN_MTU can have 3 values: -1, 0 and 1. The default is -1.
> > RFC3542 section 11.1 describe the behaviour:
> >
> > -1: perform path MTU discovery for unicast destinations but do not
> >     perform it for multicast destinations.  Packets to multicast
> >     destinations are therefore sent with the minimum MTU.
> >
> >  0: always perform path MTU discovery.
> >
> >  1: always disable path MTU discovery and send packets at the minimum
> >     MTU.

I set it to 0. By setting it to -1 or 1 multicast packets are limited to
1280 bytes.

> Okay, I will modify the patch (it does not apply to the most recent 0.5.6er 
> tip) and apply it.

Strange, I just checked again and it applied without any complaint against
olsrd-0-5-6-8de526009cb3. Maybe I should give it as an attachment.

John
-- 
John Hay -- (spam-protected) / (spam-protected)
-------------- next part --------------
--- src/bsd/net.c.orig	2009-03-17 23:52:47.000000000 +0200
+++ src/bsd/net.c	2009-03-21 21:46:26.000000000 +0200
@@ -466,6 +466,9 @@
   /* See netinet6/in6.h */
   struct ipaddr_str addrstr;
   struct ipv6_mreq mcastreq;
+#ifdef IPV6_USE_MIN_MTU
+  int on;
+#endif
 
   mcastreq.ipv6mr_multiaddr = ifs->int6_multaddr.sin6_addr;
   mcastreq.ipv6mr_interface = ifs->if_index;
@@ -491,6 +494,19 @@
     return -1;
   }
 
+#ifdef IPV6_USE_MIN_MTU
+  /*
+   * This allow multicast packets to use the full interface MTU and not
+   * be limited to 1280 bytes.
+   */
+  on = 0;
+  if (setsockopt(sock, IPPROTO_IPV6, IPV6_USE_MIN_MTU, (char *)&on, sizeof(on)) < 0) {
+    perror("IPV6_USE_MIN_MTU failed");
+    close(sock);
+    return -1;
+  }
+#endif
+
   OLSR_PRINTF(3, "OK\n");
   return 0;
 }


More information about the Olsr-dev mailing list