From: angelos Date: Wed, 12 Apr 2000 18:05:47 +0000 (+0000) Subject: Fix checksum for outgoing etherip/ipip packets from enc interfaces. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5cff1e9eb1c38a73f07d97870c11d771f906abc6;p=openbsd Fix checksum for outgoing etherip/ipip packets from enc interfaces. --- 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 */