Bugzilla – Attachment 3016 Details for
Bug 2735
Wrong address family handling for tun devices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
revised again
bz2735.diff (text/plain), 1.54 KB, created by
Damien Miller
on 2017-07-21 14:39:01 AEST
(
hide
)
Description:
revised again
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2017-07-21 14:39:01 AEST
Size:
1.54 KB
patch
obsolete
>commit d96a02a8ec8c3ccbac2ed4452d0137d9be8b0122 >Author: Damien Miller <djm@mindrot.org> >Date: Fri Jul 21 14:38:16 2017 +1000 > > bz2735 > >diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c >index a444adf1..16fcd9ed 100644 >--- a/openbsd-compat/port-tun.c >+++ b/openbsd-compat/port-tun.c >@@ -224,11 +224,11 @@ sys_tun_infilter(struct Channel *c, char *buf, int len) > iph = (struct ip *)(ptr + sizeof(u_int32_t)); > switch (iph->ip_v) { > case 6: >- *af = AF_INET6; >+ *af = htonl(AF_INET6); > break; > case 4: > default: >- *af = AF_INET; >+ *af = htonl(AF_INET); > break; > } > #endif >@@ -253,7 +253,7 @@ u_char * > sys_tun_outfilter(struct Channel *c, u_char **data, u_int *dlen) > { > u_char *buf; >- u_int32_t *af; >+ u_int32_t af; > int r; > size_t xxx_dlen; > >@@ -262,21 +262,19 @@ sys_tun_outfilter(struct Channel *c, u_char **data, u_int *dlen) > fatal("%s: buffer error: %s", __func__, ssh_err(r)); > if (dlen != NULL) > *dlen = xxx_dlen; >- if (*dlen < sizeof(*af)) >+ if (*dlen < sizeof(af)) > return (NULL); > buf = *data; > > #if defined(SSH_TUN_PREPEND_AF) >- *dlen -= sizeof(u_int32_t); >- buf = *data + sizeof(u_int32_t); >+ /* skip address family */ >+ *dlen -= sizeof(af); >+ buf = *data + sizeof(af); > #elif defined(SSH_TUN_COMPAT_AF) >- af = ntohl(*(u_int32_t *)buf); >- if (*af == OPENBSD_AF_INET6) >- *af = htonl(AF_INET6); >- else >- *af = htonl(AF_INET); >+ /* translate address family */ >+ af = (ntohl(PEEK_U32(buf)) == OPENBSD_AF_INET6) ? AF_INET6 : AF_INET; >+ POKE_U32(buf, htonl(af)); > #endif >- > return (buf); > } > #endif /* SSH_TUN_FILTER */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2735
:
3005
|
3006
|
3011
|
3016
|
3017
|
3019
|
3020