summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-11-09 23:22:53 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2009-11-09 23:22:53 +0100
commit4ac7c8341c660db654821ed2dc0273645dc19645 (patch)
tree246c5cd54ab5a851a6f7a8397515e0e0f61fbbe7 /proto
parent3f22fa9e74c8643d3e4f7e3a7b4f2aa992ad09f5 (diff)
downloadbird-4ac7c8341c660db654821ed2dc0273645dc19645.tar
bird-4ac7c8341c660db654821ed2dc0273645dc19645.zip
Use IPv6 checksums in OSPFv3.
Diffstat (limited to 'proto')
-rw-r--r--proto/ospf/iface.c6
-rw-r--r--proto/ospf/packet.c1
2 files changed, 6 insertions, 1 deletions
diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c
index 9b65961..e98414f 100644
--- a/proto/ospf/iface.c
+++ b/proto/ospf/iface.c
@@ -89,6 +89,12 @@ ospf_open_socket(struct ospf_iface *ifa, int mc)
if (sk_open(ipsk) != 0)
goto err;
+#ifdef OSPFv3
+ /* 12 is an offset of the checksum in an OSPF packet */
+ if (sk_set_ipv6_checksum(ipsk, 12) < 0)
+ goto err;
+#endif
+
if (mc)
{
if (sk_setup_multicast(ipsk) < 0)
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index 9422a9f..94ec010 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -320,7 +320,6 @@ ospf_rx_hook(sock * sk, int size)
return 1;
}
- /* FIXME - handle checksums in OSPFv3 */
#ifdef OSPFv2
if ((ps->autype != htons(OSPF_AUTH_CRYPT)) &&
(!ipsum_verify(ps, 16, (void *) ps + sizeof(struct ospf_packet),