summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-04-11 10:19:54 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-04-11 10:19:54 +0200
commit7969ea3b41db05294c78a5e0ec0bd3c29ae8c549 (patch)
tree68a56a439cb48cfbadb43b8383642764fba4330e
parentd759c1a6f834cd8a8a7c264d159b9ceb246aec2a (diff)
Fixes a bug in OSPF on NBMA interfaces.
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.
-rw-r--r--proto/ospf/packet.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index b47cbfc7..e78eeea5 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -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) -