diff options
author | Damien Miller <djm@mindrot.org> | 2017-09-12 18:01:35 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-09-12 18:01:35 +1000 |
commit | 871f1e4374420b07550041b329627c474abc3010 (patch) | |
tree | 8b01b89e95aa3faf6a2eb9be50fee5a25928a7f6 /openbsd-compat | |
parent | 4ec0bb9f9ad7b4eb0af110fa8eddf8fa199e46bb (diff) | |
download | openssh-git-871f1e4374420b07550041b329627c474abc3010.tar.gz |
adapt portable to channels API changes
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/port-tun.c | 12 | ||||
-rw-r--r-- | openbsd-compat/port-tun.h | 5 |
2 files changed, 8 insertions, 9 deletions
diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index a7a5d949..7579c608 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -207,7 +207,7 @@ sys_tun_open(int tun, int mode) #define OPENBSD_AF_INET6 24 int -sys_tun_infilter(struct Channel *c, char *buf, int _len) +sys_tun_infilter(struct ssh *ssh, struct Channel *c, char *buf, int _len) { int r; size_t len; @@ -245,24 +245,22 @@ sys_tun_infilter(struct Channel *c, char *buf, int _len) POKE_U32(buf, af == AF_INET6 ? OPENBSD_AF_INET6 : OPENBSD_AF_INET); #endif - if ((r = sshbuf_put_string(&c->input, ptr, len)) != 0) + if ((r = sshbuf_put_string(c->input, ptr, len)) != 0) fatal("%s: buffer error: %s", __func__, ssh_err(r)); return (0); } u_char * -sys_tun_outfilter(struct Channel *c, u_char **data, u_int *dlen) +sys_tun_outfilter(struct ssh *ssh, struct Channel *c, + u_char **data, size_t *dlen) { u_char *buf; u_int32_t af; int r; - size_t xxx_dlen; /* XXX new API is incompatible with this signature. */ - if ((r = sshbuf_get_string(&c->output, data, &xxx_dlen)) != 0) + if ((r = sshbuf_get_string(c->output, data, dlen)) != 0) fatal("%s: buffer error: %s", __func__, ssh_err(r)); - if (dlen != NULL) - *dlen = xxx_dlen; if (*dlen < sizeof(af)) return (NULL); buf = *data; diff --git a/openbsd-compat/port-tun.h b/openbsd-compat/port-tun.h index c53df01f..10351437 100644 --- a/openbsd-compat/port-tun.h +++ b/openbsd-compat/port-tun.h @@ -18,6 +18,7 @@ #define _PORT_TUN_H struct Channel; +struct ssh; #if defined(SSH_TUN_LINUX) || defined(SSH_TUN_FREEBSD) # define CUSTOM_SYS_TUN_OPEN @@ -26,8 +27,8 @@ int sys_tun_open(int, int); #if defined(SSH_TUN_COMPAT_AF) || defined(SSH_TUN_PREPEND_AF) # define SSH_TUN_FILTER -int sys_tun_infilter(struct Channel *, char *, int); -u_char *sys_tun_outfilter(struct Channel *, u_char **, u_int *); +int sys_tun_infilter(struct ssh *, struct Channel *, char *, int); +u_char *sys_tun_outfilter(struct ssh *, struct Channel *, u_char **, size_t *); #endif #endif |