summaryrefslogtreecommitdiff
path: root/proto/ospf/packet.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-11-04 17:22:43 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-11-04 17:22:43 +0100
commitd5356072ac18d5b0eb12f14afca6bfbea702dda2 (patch)
tree3013ad55e7750ede3fdcae459a2fb1b72b60614a /proto/ospf/packet.c
parentd3209d939d4d0d8801432f212edd4302a7d03633 (diff)
Fixes a bug in LSA update of large LSAs.
Diffstat (limited to 'proto/ospf/packet.c')
-rw-r--r--proto/ospf/packet.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index 6ae29a88..bfc17d76 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