diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-11-04 17:22:43 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-11-04 17:22:43 +0100 |
commit | d5356072ac18d5b0eb12f14afca6bfbea702dda2 (patch) | |
tree | 3013ad55e7750ede3fdcae459a2fb1b72b60614a /proto/ospf/packet.h | |
parent | d3209d939d4d0d8801432f212edd4302a7d03633 (diff) |
Fixes a bug in LSA update of large LSAs.
Diffstat (limited to 'proto/ospf/packet.h')
-rw-r--r-- | proto/ospf/packet.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/proto/ospf/packet.h b/proto/ospf/packet.h index 1c74a703..c0185b9c 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_ */ |