summaryrefslogtreecommitdiffstats
path: root/proto/ospf/packet.c
diff options
context:
space:
mode:
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 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