diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2018-11-14 23:55:05 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2018-11-14 23:55:05 +0000 |
commit | 31d4add80034deab8abe22f33ad76b851276f8aa (patch) | |
tree | c8c75c2e5d9a4a8c2d2c52f716c91f49999cbe42 /sys/netinet/ip_ecn.h | |
parent | 6895f086d1fdab9637eb8127588bbf0be23cf0bd (diff) |
provide ip_tos_patch() for setting ip_tos and patching the ipv4 cksum.
previously the gif code would patch the tos field and not recalc
the cksum, which would cause ip input code to drop the packet due
to a cksum failure. the ipip code patched ip_tos and unconditionally
recalculated the cksum, making it correct, but also wiping out any
errors that may have been present before the recalculation. updating
the cksum rather than replacing it lets cksum failures still fire.
ip_tos_patch() is provided in the ecn code since it's because of ecn
propagation that we need to update the tos field. internally it
works like pf_patch_8 and pf_cksum_fixup, but since pf is optional
it rolls its own code. procter may fix that in the future...
ok claudio@
Diffstat (limited to 'sys/netinet/ip_ecn.h')
-rw-r--r-- | sys/netinet/ip_ecn.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/ip_ecn.h b/sys/netinet/ip_ecn.h index d6a8b166f1a..6f3d552468f 100644 --- a/sys/netinet/ip_ecn.h +++ b/sys/netinet/ip_ecn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ecn.h,v 1.6 2012/03/15 16:37:11 markus Exp $ */ +/* $OpenBSD: ip_ecn.h,v 1.7 2018/11/14 23:55:04 dlg Exp $ */ /* $KAME: ip_ecn.h,v 1.5 2000/03/27 04:58:38 sumikawa Exp $ */ /* @@ -47,5 +47,6 @@ #if defined(_KERNEL) extern void ip_ecn_ingress(int, u_int8_t *, u_int8_t *); extern int ip_ecn_egress(int, u_int8_t *, u_int8_t *); +void ip_tos_patch(struct ip *, uint8_t); #endif /* _KERNEL */ #endif /* _NETINET_IP_ECN_H_ */ |