Maximal packet size in virtual links is 576.

This commit is contained in:
Ondrej Filip 2005-03-15 20:51:33 +00:00
parent e300066d5f
commit e6ea2e375e
2 changed files with 7 additions and 3 deletions

View file

@ -10,6 +10,7 @@
#define _BIRD_OSPF_H_ #define _BIRD_OSPF_H_
#define MAXNETS 10 #define MAXNETS 10
#define OSPF_VLINK_MTU 576 /* RFC2328 - A.1 */
#undef OSPF_BIG_PACKETS /* #undef OSPF_BIG_PACKETS /*
* RFC 2328 says, maximum packet size is 65535 * RFC 2328 says, maximum packet size is 65535
* This could be too much for small systems, so I * This could be too much for small systems, so I

View file

@ -1,7 +1,7 @@
/* /*
* BIRD -- OSPF * 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. * 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 unsigned
ospf_pkt_maxsize(struct ospf_iface *ifa) ospf_pkt_maxsize(struct ospf_iface *ifa)
{ {
return ifa->iface->mtu - SIZE_OF_IP_HEADER - unsigned mtu = (ifa->type == OSPF_IT_VLINK) ? OSPF_VLINK_MTU : ifa->iface->mtu;
((ifa->autype == OSPF_AUTH_CRYPT) ? OSPF_AUTH_CRYPT_SIZE : 0); /* 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 void