summaryrefslogtreecommitdiff
path: root/sysdep/linux/sysio.h
diff options
context:
space:
mode:
authorAlexander Zubkov <green@qrator.net>2024-06-26 16:29:57 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2024-06-26 16:29:57 +0200
commit8a40bccffe9e28e211fe996845658f87f5cc60e9 (patch)
treebd01e74c27ba6de8cb571475ffd7534d8d8e97e1 /sysdep/linux/sysio.h
parent00b139bd25c77b401d2065283cb970d9d8c1aa02 (diff)
BFD: Add option to accept zero checksum for IPv6 UDP packets
Some vendors do not fill the checksum for IPv6 UDP packets. For interoperability with such implementations one can set UDP_NO_CHECK6_RX socket option on Linux. Thanks to Ville O for the suggestion. Minor changes by committer.
Diffstat (limited to 'sysdep/linux/sysio.h')
-rw-r--r--sysdep/linux/sysio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sysdep/linux/sysio.h b/sysdep/linux/sysio.h
index f13eda7c..5e71b535 100644
--- a/sysdep/linux/sysio.h
+++ b/sysdep/linux/sysio.h
@@ -285,3 +285,12 @@ sk_set_freebind(sock *s)
return 0;
}
+
+static inline int
+sk_set_udp6_no_csum_rx(sock *s)
+{
+ int y = 1;
+
+ if (setsockopt(s->fd, SOL_UDP, UDP_NO_CHECK6_RX, &y, sizeof(y)) < 0)
+ ERR("UDP_NO_CHECK6_RX");
+}