From c398c479bb34014ea7f89e639247fbf0b8622f6a Mon Sep 17 00:00:00 2001 From: bluhm Date: Thu, 11 Jan 2018 16:02:31 +0000 Subject: [PATCH] Advance data pointer after exporting SA type to userland. Otherwise ipsecctl(8) may display bundled SA incorrectly. from markus@ --- sys/net/pfkeyv2_convert.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c index 8b129e461b1..3656994ff19 100644 --- a/sys/net/pfkeyv2_convert.c +++ b/sys/net/pfkeyv2_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2_convert.c,v 1.62 2017/09/08 05:36:53 deraadt Exp $ */ +/* $OpenBSD: pfkeyv2_convert.c,v 1.63 2018/01/11 16:02:31 bluhm Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@keromytis.org) * @@ -543,7 +543,7 @@ export_encap(void **p, struct sockaddr_encap *encap, int type) } *p += PADUP(sizeof(struct sockaddr_in)); break; - case SENT_IP6: + case SENT_IP6: saddr->sadb_address_len = (sizeof(struct sadb_address) + PADUP(sizeof(struct sockaddr_in6))) / sizeof(uint64_t); sunion->sa.sa_len = sizeof(struct sockaddr_in6); @@ -896,4 +896,5 @@ export_satype(void **p, struct tdb *tdb) sab->sadb_protocol_len = sizeof(struct sadb_protocol) / sizeof(uint64_t); sab->sadb_protocol_proto = tdb->tdb_satype; + *p += sizeof(struct sadb_protocol); } -- 2.20.1