]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
OSPF can accept larger packets than MTU.
authorOndrej Filip <feela@network.cz>
Mon, 14 Mar 2005 11:24:56 +0000 (11:24 +0000)
committerOndrej Filip <feela@network.cz>
Mon, 14 Mar 2005 11:24:56 +0000 (11:24 +0000)
proto/ospf/iface.c
proto/ospf/ospf.h

index e4070fd6eb894a29d7ff2d4da2869af2c2eb926f..330628551c4b39270a092f2c46f66cd26704a887 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.
  */
@@ -59,7 +59,7 @@ ospf_open_ip_socket(struct ospf_iface *ifa)
   ipsk->tx_hook = ospf_tx_hook;
   ipsk->err_hook = ospf_err_hook;
   ipsk->iface = ifa->iface;
-  ipsk->rbsize = ifa->iface->mtu;
+  ipsk->rbsize = OSPF_MAX_PKT_SIZE;
   ipsk->tbsize = ifa->iface->mtu;
   ipsk->data = (void *) ifa;
   if (sk_open(ipsk) != 0)
@@ -126,7 +126,7 @@ ospf_iface_chstate(struct ospf_iface *ifa, u8 state)
            ifa->dr_sk->tx_hook = ospf_tx_hook;
            ifa->dr_sk->err_hook = ospf_err_hook;
            ifa->dr_sk->iface = ifa->iface;
-           ifa->dr_sk->rbsize = ifa->iface->mtu;
+           ifa->dr_sk->rbsize = OSPF_MAX_PKT_SIZE;
            ifa->dr_sk->tbsize = ifa->iface->mtu;
            ifa->dr_sk->data = (void *) ifa;
            if (sk_open(ifa->dr_sk) != 0)
@@ -299,7 +299,7 @@ ospf_open_mc_socket(struct ospf_iface *ifa)
   mcsk->tx_hook = ospf_tx_hook;
   mcsk->err_hook = ospf_err_hook;
   mcsk->iface = ifa->iface;
-  mcsk->rbsize = ifa->iface->mtu;
+  mcsk->rbsize = OSPF_MAX_PKT_SIZE;
   mcsk->tbsize = ifa->iface->mtu;
   mcsk->data = (void *) ifa;
   if (sk_open(mcsk) != 0)
@@ -523,19 +523,19 @@ ospf_iface_notify(struct proto *p, unsigned flags, struct iface *iface)
       OSPF_TRACE(D_EVENTS, "Changing MTU on interface %s.", iface->name);
       if (ifa->hello_sk)
       {
-       ifa->hello_sk->rbsize = ifa->iface->mtu;
+       ifa->hello_sk->rbsize = OSPF_MAX_PKT_SIZE;
        ifa->hello_sk->tbsize = ifa->iface->mtu;
        sk_reallocate(ifa->hello_sk);
       }
       if (ifa->dr_sk)
       {
-       ifa->dr_sk->rbsize = ifa->iface->mtu;
+       ifa->dr_sk->rbsize = OSPF_MAX_PKT_SIZE;
        ifa->dr_sk->tbsize = ifa->iface->mtu;
        sk_reallocate(ifa->dr_sk);
       }
       if (ifa->ip_sk)
       {
-       ifa->ip_sk->rbsize = ifa->iface->mtu;
+       ifa->ip_sk->rbsize = OSPF_MAX_PKT_SIZE;
        ifa->ip_sk->tbsize = ifa->iface->mtu;
        sk_reallocate(ifa->ip_sk);
       }
index 79d1f4f73a1ebfac9604466c7e5c7eab6aae7461..e52a6efb55b837923d583e92764c84fd86f09810 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.
  */
 #define _BIRD_OSPF_H_
 
 #define MAXNETS 10
+#undef OSPF_BIG_PACKETS        /*
+                         * RFC 2328 says, maximum packet size is 65535
+                        * This could be too much for small systems, so I
+                        * normally allocate 2*mtu - (I found one cisco
+                        * sending packets mtu+16)
+                        */
+
+#ifdef OSPF_BIG_PACKETS
+#define OSPF_MAX_PKT_SIZE 65536
+#else
+#define OSPF_MAX_PKT_SIZE (ifa->iface->mtu * 2)
+#endif
+
 #ifdef LOCAL_DEBUG
 #define OSPF_FORCE_DEBUG 1
 #else