From 5cff1e9eb1c38a73f07d97870c11d771f906abc6 Mon Sep 17 00:00:00 2001 From: angelos Date: Wed, 12 Apr 2000 18:05:47 +0000 Subject: [PATCH] Fix checksum for outgoing etherip/ipip packets from enc interfaces. --- sys/net/if_enc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index 9f7edda7e57..329a342d690 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_enc.c,v 1.27 2000/04/10 07:34:53 angelos Exp $ */ +/* $OpenBSD: if_enc.c,v 1.28 2000/04/12 18:05:47 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -261,6 +261,17 @@ struct ifnet *ifp; mp = NULL; } +#ifdef INET + /* Fix header checksum for IPv4 */ + if (tdb->tdb_dst.sa.sa_family == AF_INET) + { + struct ip *ip; + + ip = mtod(m, struct ip *); + ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + } +#endif + protoflag = tdb->tdb_dst.sa.sa_family; /* IPsec packet processing -- skip encapsulation */ -- 2.20.1