From d5356072ac18d5b0eb12f14afca6bfbea702dda2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 4 Nov 2010 17:22:43 +0100 Subject: Fixes a bug in LSA update of large LSAs. --- proto/ospf/packet.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'proto/ospf/packet.c') diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c index 6ae29a8..bfc17d7 100644 --- a/proto/ospf/packet.c +++ b/proto/ospf/packet.c @@ -39,19 +39,17 @@ ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type) unsigned ospf_pkt_maxsize(struct ospf_iface *ifa) { - /* For virtual links use mtu=576, can be mtu < 576? */ unsigned mtu = (ifa->type == OSPF_IT_VLINK) ? OSPF_VLINK_MTU : ifa->iface->mtu; - unsigned add = 0; + unsigned headers = SIZE_OF_IP_HEADER; #ifdef OSPFv2 - add = ((ifa->autype == OSPF_AUTH_CRYPT) ? OSPF_AUTH_CRYPT_SIZE : 0); + if (ifa->autype == OSPF_AUTH_CRYPT) + headers += OSPF_AUTH_CRYPT_SIZE; #endif - return ((mtu <= ifa->iface->mtu) ? mtu : ifa->iface->mtu) - - SIZE_OF_IP_HEADER - add; + return mtu - headers; } - #ifdef OSPFv2 static void -- cgit v1.2.3