summaryrefslogtreecommitdiff
path: root/proto/ospf/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf/packet.c')
-rw-r--r--proto/ospf/packet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index faa33664..9690c28a 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -23,7 +23,7 @@ ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type)
pkt->version = ospf_get_version(p);
pkt->type = h_type;
- pkt->length = htons(ospf_pkt_maxsize(ifa));
+ pkt->length = htons(ospf_pkt_maxsize(p, ifa));
pkt->routerid = htonl(p->router_id);
pkt->areaid = htonl(ifa->oa->areaid);
pkt->checksum = 0;
@@ -32,9 +32,9 @@ ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type)
}
uint
-ospf_pkt_maxsize(struct ospf_iface *ifa)
+ospf_pkt_maxsize(struct ospf_proto *p, struct ospf_iface *ifa)
{
- uint headers = SIZE_OF_IP_HEADER;
+ uint headers = ospf_is_v2(p) ? IP4_HEADER_LENGTH : IP6_HEADER_LENGTH;
/* Relevant just for OSPFv2 */
if (ifa->autype == OSPF_AUTH_CRYPT)
@@ -235,7 +235,7 @@ ospf_rx_hook(sock *sk, int len)
return 1;
int src_local, dst_local, dst_mcast;
- src_local = ipa_in_net(sk->faddr, ifa->addr->prefix, ifa->addr->pxlen);
+ src_local = ipa_in_netX(sk->faddr, &ifa->addr->prefix);
dst_local = ipa_equal(sk->laddr, ifa->addr->ip);
dst_mcast = ipa_equal(sk->laddr, ifa->all_routers) || ipa_equal(sk->laddr, ifa->des_routers);