summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_output.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2018-02-11 00:24:14 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2018-02-11 00:24:14 +0000
commitb5cad63e758681a258401baff81bc4f76111ff0c (patch)
tree6f09acb990dac65cd3097f9e58d1f2f4350d0b6e /sys/netinet6/ip6_output.c
parentea2c12868ddfa27c668a12315b402d171c8fcca2 (diff)
add an ipv6 "don't fragment" flag to mbufs for ip6_output to use.
if you need to send an ipv6 packet with ip6_send(), there's no DF bit in an ipv6 packet and no way to pass the ip6 options to ip6_output to tell it to not allow fragmentation. this adds an M_IPV6_DF_OUT "checksum" flag so something creating ipv6 packets a long way from ip6_output can easily tell it to not allow fragmentation. grumbling and ok claudio@
Diffstat (limited to 'sys/netinet6/ip6_output.c')
-rw-r--r--sys/netinet6/ip6_output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 03fc4fae449..4818d7cb441 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.232 2017/09/01 15:05:31 mpi Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.233 2018/02/11 00:24:13 dlg Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -656,7 +656,10 @@ reroute:
*/
tlen = m->m_pkthdr.len;
- if (opt && (opt->ip6po_flags & IP6PO_DONTFRAG))
+ if (ISSET(m->m_pkthdr.csum_flags, M_IPV6_DF_OUT)) {
+ CLR(m->m_pkthdr.csum_flags, M_IPV6_DF_OUT);
+ dontfrag = 1;
+ } else if (opt && ISSET(opt->ip6po_flags, IP6PO_DONTFRAG))
dontfrag = 1;
else
dontfrag = 0;