diff options
Diffstat (limited to 'sys/netinet/ip_ahsha1.c')
-rw-r--r-- | sys/netinet/ip_ahsha1.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/netinet/ip_ahsha1.c b/sys/netinet/ip_ahsha1.c index b7cc04425f0..61bece49bc2 100644 --- a/sys/netinet/ip_ahsha1.c +++ b/sys/netinet/ip_ahsha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ahsha1.c,v 1.4 1997/06/24 20:57:26 provos Exp $ */ +/* $OpenBSD: ip_ahsha1.c,v 1.5 1997/06/25 07:53:23 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -194,10 +194,14 @@ ahsha1_input(struct mbuf *m, struct tdb *tdb) switch (IPOPT_NUMBER(optval)) { case IPOPT_EOL: + SHA1Update(&ctx, ipseczeroes, 1); + off = ip->ip_hl << 2; + break; + case IPOPT_NOP: SHA1Update(&ctx, ipseczeroes, 1); off++; - continue; + break; case IPOPT_SECURITY: case 133: @@ -205,13 +209,13 @@ ahsha1_input(struct mbuf *m, struct tdb *tdb) optval = ((u_int8_t *)ip)[off + 1]; SHA1Update(&ctx, (u_int8_t *)ip + off, optval); off += optval; - continue; + break; default: optval = ((u_int8_t *)ip)[off + 1]; SHA1Update(&ctx, ipseczeroes, optval); off += optval; - continue; + break; } } @@ -279,8 +283,8 @@ ahsha1_input(struct mbuf *m, struct tdb *tdb) ip->ip_sum = in_cksum(m, sizeof (struct ip)); /* Update the counters */ - tdb->tdb_packets++; - tdb->tdb_bytes += ntohs(ip->ip_len) - (ip->ip_hl << 2); + tdb->tdb_cur_packets++; + tdb->tdb_cur_bytes += ntohs(ip->ip_len) - (ip->ip_hl << 2); return m; } @@ -402,9 +406,9 @@ ahsha1_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struct *mp = m; /* Update the counters */ - tdb->tdb_packets++; - tdb->tdb_bytes += ip->ip_len - (ip->ip_hl << 2) - AH_FLENGTH - - xd->amx_alen; + tdb->tdb_cur_packets++; + tdb->tdb_cur_bytes += ip->ip_len - (ip->ip_hl << 2) - AH_FLENGTH - + xd->amx_alen; return 0; } |