Revision fe9f1a6d proto/ospf/packet.c

View differences:

proto/ospf/packet.c
22 22

  
23 23
  pkt->version = ospf_get_version(p);
24 24
  pkt->type = h_type;
25
  pkt->length = htons(ospf_pkt_maxsize(ifa));
25
  pkt->length = htons(ospf_pkt_maxsize(p, ifa));
26 26
  pkt->routerid = htonl(p->router_id);
27 27
  pkt->areaid = htonl(ifa->oa->areaid);
28 28
  pkt->checksum = 0;
......
31 31
}
32 32

  
33 33
uint
34
ospf_pkt_maxsize(struct ospf_iface *ifa)
34
ospf_pkt_maxsize(struct ospf_proto *p, struct ospf_iface *ifa)
35 35
{
36
  uint headers = SIZE_OF_IP_HEADER;
36
  uint headers = ospf_is_v2(p) ? IP4_HEADER_LENGTH : IP6_HEADER_LENGTH;
37 37

  
38 38
  /* Relevant just for OSPFv2 */
39 39
  if (ifa->autype == OSPF_AUTH_CRYPT)

Also available in: Unified diff