summaryrefslogtreecommitdiff
path: root/openbsd-compat/port-tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/port-tun.c')
-rw-r--r--openbsd-compat/port-tun.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c
index a7a5d949a..7579c6084 100644
--- a/openbsd-compat/port-tun.c
+++ b/openbsd-compat/port-tun.c
@@ -207,7 +207,7 @@ sys_tun_open(int tun, int mode)
207#define OPENBSD_AF_INET6 24 207#define OPENBSD_AF_INET6 24
208 208
209int 209int
210sys_tun_infilter(struct Channel *c, char *buf, int _len) 210sys_tun_infilter(struct ssh *ssh, struct Channel *c, char *buf, int _len)
211{ 211{
212 int r; 212 int r;
213 size_t len; 213 size_t len;
@@ -245,24 +245,22 @@ sys_tun_infilter(struct Channel *c, char *buf, int _len)
245 POKE_U32(buf, af == AF_INET6 ? OPENBSD_AF_INET6 : OPENBSD_AF_INET); 245 POKE_U32(buf, af == AF_INET6 ? OPENBSD_AF_INET6 : OPENBSD_AF_INET);
246#endif 246#endif
247 247
248 if ((r = sshbuf_put_string(&c->input, ptr, len)) != 0) 248 if ((r = sshbuf_put_string(c->input, ptr, len)) != 0)
249 fatal("%s: buffer error: %s", __func__, ssh_err(r)); 249 fatal("%s: buffer error: %s", __func__, ssh_err(r));
250 return (0); 250 return (0);
251} 251}
252 252
253u_char * 253u_char *
254sys_tun_outfilter(struct Channel *c, u_char **data, u_int *dlen) 254sys_tun_outfilter(struct ssh *ssh, struct Channel *c,
255 u_char **data, size_t *dlen)
255{ 256{
256 u_char *buf; 257 u_char *buf;
257 u_int32_t af; 258 u_int32_t af;
258 int r; 259 int r;
259 size_t xxx_dlen;
260 260
261 /* XXX new API is incompatible with this signature. */ 261 /* XXX new API is incompatible with this signature. */
262 if ((r = sshbuf_get_string(&c->output, data, &xxx_dlen)) != 0) 262 if ((r = sshbuf_get_string(c->output, data, dlen)) != 0)
263 fatal("%s: buffer error: %s", __func__, ssh_err(r)); 263 fatal("%s: buffer error: %s", __func__, ssh_err(r));
264 if (dlen != NULL)
265 *dlen = xxx_dlen;
266 if (*dlen < sizeof(af)) 264 if (*dlen < sizeof(af))
267 return (NULL); 265 return (NULL);
268 buf = *data; 266 buf = *data;