summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-06-06 16:09:36 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-06-06 16:09:36 +0000
commitbdabc6300f84ee5cc811f21d6e360dccd8f92e65 (patch)
tree1a004dc718e83d3091643132e8ca40708732f6c9 /sbin/iked
parent2a98c24d5ca3fe56900d9c54df9372842928b561 (diff)
Use same pattern to work with offset by using a uint8_t pointer that
is loaded with ibuf_data(). This is by no means better but allows to switch ibuf_data() to return void *. OK tb@
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/ikev2_pld.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/iked/ikev2_pld.c b/sbin/iked/ikev2_pld.c
index a055c2f1be1..cef586817a1 100644
--- a/sbin/iked/ikev2_pld.c
+++ b/sbin/iked/ikev2_pld.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2_pld.c,v 1.128 2023/05/23 13:12:19 claudio Exp $ */
+/* $OpenBSD: ikev2_pld.c,v 1.129 2023/06/06 16:09:35 claudio Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -1525,9 +1525,10 @@ ikev2_pld_ts(struct iked *env, struct ikev2_payload *pld,
struct sockaddr_in s4;
struct sockaddr_in6 s6;
uint8_t buf[2][128];
+ uint8_t *msgbuf = ibuf_data(msg->msg_data);
uint8_t *ptr;
- ptr = ibuf_data(msg->msg_data) + offset;
+ ptr = msgbuf + offset;
switch (type) {
case IKEV2_TS_IPV4_ADDR_RANGE:
@@ -1867,6 +1868,7 @@ ikev2_pld_cp(struct iked *env, struct ikev2_payload *pld,
struct iked_addr *addr;
struct sockaddr_in *in4;
struct sockaddr_in6 *in6;
+ uint8_t *msgbuf = ibuf_data(msg->msg_data);
uint8_t *ptr;
size_t len;
uint8_t buf[128];
@@ -1875,7 +1877,7 @@ ikev2_pld_cp(struct iked *env, struct ikev2_payload *pld,
if (ikev2_validate_cp(msg, offset, left, &cp))
return (-1);
- ptr = ibuf_data(msg->msg_data) + offset + sizeof(cp);
+ ptr = msgbuf + offset + sizeof(cp);
len = left - sizeof(cp);
log_debug("%s: type %s length %zu",