FreeBSD Bugzilla – Attachment 177744 Details for
Bug 215105
link_ntoa() hex formatting breakage in today's patch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch #2, somewhat tested
linkaddr.c.diff (text/plain), 1.21 KB, created by
Gleb Smirnoff
on 2016-12-07 08:28:42 UTC
(
hide
)
Description:
proposed patch #2, somewhat tested
Filename:
MIME Type:
Creator:
Gleb Smirnoff
Created:
2016-12-07 08:28:42 UTC
Size:
1.21 KB
patch
obsolete
>Index: lib/libc/net/linkaddr.c >=================================================================== >--- lib/libc/net/linkaddr.c (revision 309667) >+++ lib/libc/net/linkaddr.c (working copy) >@@ -125,7 +125,7 @@ link_ntoa(const struct sockaddr_dl *sdl) > static char obuf[64]; > _Static_assert(sizeof(obuf) >= IFNAMSIZ + 20, "obuf is too small"); > char *out; >- const char *in, *inlim; >+ const u_char *in, *inlim; > int namelen, i, rem; > > namelen = (sdl->sdl_nlen <= IFNAMSIZ) ? sdl->sdl_nlen : IFNAMSIZ; >@@ -142,11 +142,11 @@ link_ntoa(const struct sockaddr_dl *sdl) > } > } > >- in = (const char *)sdl->sdl_data + sdl->sdl_nlen; >+ in = (const u_char *)sdl->sdl_data + sdl->sdl_nlen; > inlim = in + sdl->sdl_alen; > > while (in < inlim && rem > 1) { >- if (in != (const char *)sdl->sdl_data + sdl->sdl_nlen) { >+ if (in != (const u_char *)sdl->sdl_data + sdl->sdl_nlen) { > *out++ = '.'; > rem--; > } >@@ -154,15 +154,14 @@ link_ntoa(const struct sockaddr_dl *sdl) > if (i > 0xf) { > if (rem < 3) > break; >+ *out++ = hexlist[i >> 4]; > *out++ = hexlist[i & 0xf]; >- i >>= 4; >- *out++ = hexlist[i]; > rem -= 2; > } else { > if (rem < 2) > break; > *out++ = hexlist[i]; >- rem++; >+ rem--; > } > } > *out = 0;
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
Actions:
View
|
Diff
Attachments on
bug 215105
:
177740
| 177744