summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-07-03 09:38:09 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-07-03 09:38:09 +0000
commitf977c33486a3ba4b82ef4861c589466fc5cf190a (patch)
treeb7f9db6fb8be931d3bcfa818413f03bb365d7778 /usr.sbin/relayd
parent6e337358e477f85b882d4fdd3ebffea1a108ce7a (diff)
Use ibuf_data() instead of accessing ibuf->buf directly.
OK tb@
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/check_tcp.c6
-rw-r--r--usr.sbin/relayd/check_tls.c6
-rw-r--r--usr.sbin/relayd/parse.y4
3 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/relayd/check_tcp.c b/usr.sbin/relayd/check_tcp.c
index 9bcb40ff998..4f6ded93507 100644
--- a/usr.sbin/relayd/check_tcp.c
+++ b/usr.sbin/relayd/check_tcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: check_tcp.c,v 1.60 2023/06/21 07:54:54 claudio Exp $ */
+/* $OpenBSD: check_tcp.c,v 1.61 2023/07/03 09:38:08 claudio Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -214,7 +214,7 @@ tcp_send_req(int s, short event, void *arg)
req = ibuf_data(cte->table->sendbinbuf);
log_debug("%s: table %s sending binary", __func__,
cte->table->conf.name);
- print_hex(cte->table->sendbinbuf->buf, 0, len);
+ print_hex(req, 0, len);
} else {
len = strlen(cte->table->sendbuf);
req = cte->table->sendbuf;
@@ -323,7 +323,7 @@ check_send_expect(struct ctl_tcp_event *cte)
/*
* ensure string is nul-terminated.
*/
- b = strndup(cte->buf->buf, ibuf_size(cte->buf));
+ b = strndup(ibuf_data(cte->buf), ibuf_size(cte->buf));
if (b == NULL)
fatal("out of memory");
if (fnmatch(cte->table->conf.exbuf, b, 0) == 0) {
diff --git a/usr.sbin/relayd/check_tls.c b/usr.sbin/relayd/check_tls.c
index 3fe829101f7..04df50308b0 100644
--- a/usr.sbin/relayd/check_tls.c
+++ b/usr.sbin/relayd/check_tls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: check_tls.c,v 1.2 2019/09/15 19:23:29 rob Exp $ */
+/* $OpenBSD: check_tls.c,v 1.3 2023/07/03 09:38:08 claudio Exp $ */
/*
* Copyright (c) 2017 Claudio Jeker <claudio@openbsd.org>
@@ -104,10 +104,10 @@ check_tls_write(int s, short event, void *arg)
if (cte->table->sendbinbuf != NULL) {
len = ibuf_size(cte->table->sendbinbuf);
- buf = cte->table->sendbinbuf->buf;
+ buf = ibuf_data(cte->table->sendbinbuf);
log_debug("%s: table %s sending binary", __func__,
cte->table->conf.name);
- print_hex(cte->table->sendbinbuf->buf, 0, len);
+ print_hex(buf, 0, len);
} else {
len = strlen(cte->table->sendbuf);
buf = cte->table->sendbuf;
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index 22beb857229..a1250de51aa 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.253 2021/10/15 15:01:28 naddy Exp $ */
+/* $OpenBSD: parse.y,v 1.254 2023/07/03 09:38:08 claudio Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -996,7 +996,7 @@ tablecheck : ICMP { table->conf.check = CHECK_ICMP; }
free($5);
YYERROR;
}
- memcpy(table->conf.exbinbuf, ibuf->buf,
+ memcpy(table->conf.exbinbuf, ibuf_data(ibuf),
ibuf_size(ibuf));
ibuf_free(ibuf);
free($5);