]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Maximal packet size in virtual links is 576.
authorOndrej Filip <feela@network.cz>
Tue, 15 Mar 2005 20:51:33 +0000 (20:51 +0000)
committerOndrej Filip <feela@network.cz>
Tue, 15 Mar 2005 20:51:33 +0000 (20:51 +0000)
proto/ospf/ospf.h
proto/ospf/packet.c

index e52a6efb55b837923d583e92764c84fd86f09810..1bb7f872390a01d19d9f754ef09d615ee8b68144 100644 (file)
@@ -10,6 +10,7 @@
 #define _BIRD_OSPF_H_
 
 #define MAXNETS 10
+#define OSPF_VLINK_MTU 576     /* RFC2328 - A.1 */
 #undef OSPF_BIG_PACKETS        /*
                          * RFC 2328 says, maximum packet size is 65535
                         * This could be too much for small systems, so I
index 443efa06215db86949af6a2632eee4d0e2c3b4c8..eba4bc22f4d600c234a0ab384e27fe6b8432fddc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     BIRD -- OSPF
  *
- *     (c) 1999--2004 Ondrej Filip <feela@network.cz>
+ *     (c) 1999--2005 Ondrej Filip <feela@network.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -31,8 +31,11 @@ ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type)
 unsigned
 ospf_pkt_maxsize(struct ospf_iface *ifa)
 {
-  return ifa->iface->mtu - SIZE_OF_IP_HEADER -
-    ((ifa->autype == OSPF_AUTH_CRYPT) ? OSPF_AUTH_CRYPT_SIZE : 0);
+  unsigned mtu = (ifa->type == OSPF_IT_VLINK) ? OSPF_VLINK_MTU : ifa->iface->mtu;
+  /* Can be mtu < 576? */
+  return ((mtu <=  ifa->iface->mtu) ? mtu : ifa->iface->mtu) -
+  SIZE_OF_IP_HEADER - ((ifa->autype == OSPF_AUTH_CRYPT) ? OSPF_AUTH_CRYPT_SIZE : 0);
+  /* For virtual links use mtu=576 */
 }
 
 void