summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/in.h3
-rw-r--r--sys/netinet/ip_output.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 7c206e5d5cb..adb1b30e4d0 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.h,v 1.114 2015/04/14 12:22:15 mikeb Exp $ */
+/* $OpenBSD: in.h,v 1.115 2015/10/20 20:22:42 benno Exp $ */
/* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */
/*
@@ -306,6 +306,7 @@ struct ip_opts {
#define IP_PIPEX 34 /* bool; using PIPEX */
#define IP_RECVRTABLE 35 /* bool; receive rdomain w/dgram */
#define IP_IPSECFLOWINFO 36 /* bool; IPsec flow info for dgram */
+#define IP_IPDEFTTL 37 /* int; IP TTL system default */
#define IP_RTABLE 0x1021 /* int; routing table, see SO_RTABLE */
#define IP_DIVERTFL 0x1022 /* int; divert direction flag opt */
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 8d575b7904d..5e9147a1014 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.302 2015/10/19 12:10:05 mpi Exp $ */
+/* $OpenBSD: ip_output.c,v 1.303 2015/10/20 20:22:42 benno Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -1088,6 +1088,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname,
case IP_RECVDSTPORT:
case IP_RECVRTABLE:
case IP_IPSECFLOWINFO:
+ case IP_IPDEFTTL:
*mp = m = m_get(M_WAIT, MT_SOOPTS);
m->m_len = sizeof(int);
switch (optname) {
@@ -1104,6 +1105,10 @@ ip_ctloutput(int op, struct socket *so, int level, int optname,
optval = inp->inp_ip_minttl;
break;
+ case IP_IPDEFTTL:
+ optval = ip_defttl;
+ break;
+
#define OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0)
case IP_RECVOPTS: