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.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'proto/ospf/packet.h') diff --git a/proto/ospf/packet.h b/proto/ospf/packet.h index 1c74a70..c0185b9 100644 --- a/proto/ospf/packet.h +++ b/proto/ospf/packet.h @@ -21,4 +21,17 @@ void ospf_send_to(struct ospf_iface *ifa, ip_addr ip); static inline void * ospf_tx_buffer(struct ospf_iface *ifa) { return ifa->sk->tbuf; } +static inline unsigned +ospf_pkt_bufsize(struct ospf_iface *ifa) +{ +#ifdef OSPFv2 + unsigned headers = (ifa->autype == OSPF_AUTH_CRYPT) ? OSPF_AUTH_CRYPT_SIZE : 0; +#else + unsigned headers = 0; +#endif + + return ifa->sk->tbsize - headers; +} + + #endif /* _BIRD_OSPF_PACKET_H_ */ -- cgit v1.2.3