diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1998-07-30 08:41:22 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1998-07-30 08:41:22 +0000 |
commit | dbb95b2a0762cb45f3639fd7643bea0c6fe8dbf9 (patch) | |
tree | 99feb54b91e996543dcd49d49999dc302c52d470 /sys/netinet/ip_esp_old.c | |
parent | 78194b8d1ab41b6f00eba281ef9d90f67ab59309 (diff) |
fixing a stupid bug I introduced when trying to improve the encryption
performance by avoiding unnecessary copies. There was a problem when two
subsequent mbufs were != 0 mod blocksize and the next < blocksize, so we
lost the rest of the last mbuf as IV.
Diffstat (limited to 'sys/netinet/ip_esp_old.c')
-rw-r--r-- | sys/netinet/ip_esp_old.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/ip_esp_old.c b/sys/netinet/ip_esp_old.c index f63fd9a09a6..f93d89259cf 100644 --- a/sys/netinet/ip_esp_old.c +++ b/sys/netinet/ip_esp_old.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp_old.c,v 1.19 1998/06/11 14:17:23 provos Exp $ */ +/* $OpenBSD: ip_esp_old.c,v 1.20 1998/07/30 08:41:21 provos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -675,6 +675,12 @@ esp_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, { if (rest) { + if (ivp == blk) + { + bcopy(blk, iv, blks); + ivp = iv; + } + bcopy(idat, blk, rest); odat = idat; } |