summaryrefslogtreecommitdiffstats
path: root/sysdep/unix
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 /sysdep/unix
parent3f22fa9e74c8643d3e4f7e3a7b4f2aa992ad09f5 (diff)
downloadbird-4ac7c8341c660db654821ed2dc0273645dc19645.tar
bird-4ac7c8341c660db654821ed2dc0273645dc19645.zip
Use IPv6 checksums in OSPFv3.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/io.c19
1 files changed, 18 insertions, 1 deletions
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,13 +782,30 @@ 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)
{
char *err;