summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ip4.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1997-06-24 12:15:28 +0000
committerNiels Provos <provos@cvs.openbsd.org>1997-06-24 12:15:28 +0000
commit6e79d83bde76cc1e88a4d6bf487189769ef11465 (patch)
tree79413ebba8b387f6a704b63bf112acec6759b2cf /sys/netinet/ip_ip4.c
parentd3aefd9008254bea4ccef33b0b71ee00ec825972 (diff)
handle IP options in AH + allow IP options in outgoing encapsulated packets
+ usage counters for later use with keymanagement processes
Diffstat (limited to 'sys/netinet/ip_ip4.c')
-rw-r--r--sys/netinet/ip_ip4.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/netinet/ip_ip4.c b/sys/netinet/ip_ip4.c
index a6f5a1fc4b4..ba5cedcc307 100644
--- a/sys/netinet/ip_ip4.c
+++ b/sys/netinet/ip_ip4.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ip4.c,v 1.7 1997/06/24 02:20:23 angelos Exp $ */
+/* $OpenBSD: ip_ip4.c,v 1.8 1997/06/24 12:15:25 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -196,14 +196,21 @@ ipe4_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struct m
ipo->ip_src = gw->sen_ipsp_src;
ipo->ip_dst = gw->sen_ipsp_dst;
-/* printf("ip4_output: [%x->%x](l=%d, p=%d)",
- ntohl(ipi->ip_src.s_addr), ntohl(ipi->ip_dst.s_addr),
- ilen, ipi->ip_p);
- printf(" through [%x->%x](l=%d, p=%d)\n",
- ntohl(ipo->ip_src.s_addr), ntohl(ipo->ip_dst.s_addr),
- ipo->ip_len, ipo->ip_p);*/
+/*
+ * printf("ip4_output: [%x->%x](l=%d, p=%d)",
+ * ntohl(ipi->ip_src.s_addr), ntohl(ipi->ip_dst.s_addr),
+ * ilen, ipi->ip_p);
+ * printf(" through [%x->%x](l=%d, p=%d)\n",
+ * ntohl(ipo->ip_src.s_addr), ntohl(ipo->ip_dst.s_addr),
+ * ipo->ip_len, ipo->ip_p);
+ */
*mp = m;
+
+ /* Update the counters */
+ tdb->tdb_packets++;
+ tdb->tdb_bytes += ntohs(ipo->ip_len) - (ipo->ip_hl << 2);
+
return 0;
/* return ip_output(m, NULL, NULL, IP_ENCAPSULATED, NULL);*/