From 4ac7c8341c660db654821ed2dc0273645dc19645 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 9 Nov 2009 23:22:53 +0100 Subject: Use IPv6 checksums in OSPFv3. --- sysdep/unix/io.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 3eb2e03..cd5c5db 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -782,12 +782,29 @@ int sk_set_broadcast(sock *s, int enable) { if (setsockopt(s->fd, SOL_SOCKET, SO_BROADCAST, &enable, sizeof(enable)) < 0) - log(L_ERR "sk_set_broadcast: SO_BROADCAST: %m"); + { + log(L_ERR "sk_set_broadcast: SO_BROADCAST: %m"); + return -1; + } + + return 0; } #ifdef IPV6 +int +sk_set_ipv6_checksum(sock *s, int offset) +{ + if (setsockopt(s->fd, IPPROTO_IPV6, IPV6_CHECKSUM, &offset, sizeof(offset)) < 0) + { + log(L_ERR "sk_set_ipv6_checksum: IPV6_CHECKSUM: %m"); + return -1; + } + + return 0; +} + int sk_setup_multicast(sock *s) { -- cgit v1.2.3