summaryrefslogtreecommitdiffstats
path: root/proto/ospf/packet.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2005-03-15 21:51:33 +0100
committerOndrej Filip <feela@network.cz>2005-03-15 21:51:33 +0100
commite6ea2e375e4c547ca1b6fc9c313c2b7940acbd77 (patch)
treea524987664e1cc31a19bbd019ffce47e01d33733 /proto/ospf/packet.c
parente300066d5f66b8bd1d5561d63c10a8fbdce3ba8e (diff)
downloadbird-e6ea2e375e4c547ca1b6fc9c313c2b7940acbd77.tar
bird-e6ea2e375e4c547ca1b6fc9c313c2b7940acbd77.zip
Maximal packet size in virtual links is 576.
Diffstat (limited to 'proto/ospf/packet.c')
-rw-r--r--proto/ospf/packet.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index 443efa0..eba4bc2 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -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