]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes a bug in OSPF on NBMA interfaces.
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 11 Apr 2010 08:19:54 +0000 (10:19 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 11 Apr 2010 08:19:54 +0000 (10:19 +0200)
A very tricky bug. OSPF on NBMA interfaces probably never really worked.
When a packet was sent to multiple destinations, the checksum was
calculated multiple times from a packet with already filled checksum
field (from previous calculation). Therefore, many packets were sent
with an invalid checksum.

proto/ospf/packet.c

index b47cbfc7b0ee3438f09b65ee3b15b894eabed837..e78eeea52027c1a4dcc69780816e0b8ee4c354f0 100644 (file)
@@ -76,6 +76,7 @@ ospf_pkt_finalize(struct ospf_iface *ifa, struct ospf_packet *pkt)
       }
       password_cpy(pkt->u.password, passwd->password, sizeof(union ospf_auth));
     case OSPF_AUTH_NONE:
+      pkt->checksum = 0;
       pkt->checksum = ipsum_calculate(pkt, sizeof(struct ospf_packet) -
                                   sizeof(union ospf_auth), (pkt + 1),
                                  ntohs(pkt->length) -