summaryrefslogtreecommitdiffstats
path: root/sysdep/unix/io.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-08-16 23:05:35 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-08-16 23:13:05 +0200
commitb1b19433602f2a2ff58cfe2c1858ff883eee7b20 (patch)
tree29e8961d52b59a6023f21bcdc70b7c1932428cd3 /sysdep/unix/io.c
parenta52d52fa91ffcbcea58326fc2de476ce5644256f (diff)
downloadbird-b1b19433602f2a2ff58cfe2c1858ff883eee7b20.tar
bird-b1b19433602f2a2ff58cfe2c1858ff883eee7b20.zip
The generalized TTL security mechanism (RFC 5082) support.
Thanks to Alexander V. Chernikov for the patch.
Diffstat (limited to 'sysdep/unix/io.c')
-rw-r--r--sysdep/unix/io.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index b6c1b86..815989f 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -805,7 +805,7 @@ bad:
}
/**
- * sk_set_ttl - set TTL for given socket.
+ * sk_set_ttl - set transmit TTL for given socket.
* @s: socket
* @ttl: TTL value
*
@@ -828,6 +828,28 @@ sk_set_ttl(sock *s, int ttl)
return (err ? -1 : 0);
}
+/**
+ * sk_set_min_ttl - set minimal accepted TTL for given socket.
+ * @s: socket
+ * @ttl: TTL value
+ *
+ * Can be used in TTL security implementation
+ *
+ * Result: 0 for success, -1 for an error.
+ */
+
+int
+sk_set_min_ttl(sock *s, int ttl)
+{
+ int err;
+#ifdef IPV6
+ err = sk_set_min_ttl6(s, ttl);
+#else
+ err = sk_set_min_ttl4(s, ttl);
+#endif
+
+ return err;
+}
/**
* sk_set_md5_auth - add / remove MD5 security association for given socket.