public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug network/27835] New: inet_nsap_ntoa() strange output
@ 2021-05-09 10:38 wharms at bfs dot de
  2021-05-09 11:20 ` [Bug network/27835] " schwab@linux-m68k.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wharms at bfs dot de @ 2021-05-09 10:38 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27835

            Bug ID: 27835
           Summary: inet_nsap_ntoa() strange output
           Product: glibc
           Version: 2.33
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: wharms at bfs dot de
  Target Milestone: ---

Created attachment 13427
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13427&action=edit
simple example using inet_nsap_addr/inet_nsap_ntoa

I played with some undocumented functions and found the output
inet_nsap_ntoa().
I found no documentation about the expected behavior.


inet_nsap_ntoa() converts a given buffer in to a hexstring with dots.
the output looks like that:
 0C.2238.4E0C.2238.4E

you will notice the first and last dot make the output asymmetric.
the code says: 
                if (((i % 2) == 0 && (i + 1) < binlen))
                        *ascii++ = '.';
what does not work as intend because of a *ascii++ the line before. 
changing (i % 2) == 0 to (i % 2) == 1 changes the output into
 0C22.384E.0C22.384E

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug network/27835] inet_nsap_ntoa() strange output
  2021-05-09 10:38 [Bug network/27835] New: inet_nsap_ntoa() strange output wharms at bfs dot de
@ 2021-05-09 11:20 ` schwab@linux-m68k.org
  2021-05-29  9:12 ` fweimer at redhat dot com
  2021-05-31  7:42 ` wharms at bfs dot de
  2 siblings, 0 replies; 4+ messages in thread
From: schwab@linux-m68k.org @ 2021-05-09 11:20 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27835

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
This is compatible with BSD.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug network/27835] inet_nsap_ntoa() strange output
  2021-05-09 10:38 [Bug network/27835] New: inet_nsap_ntoa() strange output wharms at bfs dot de
  2021-05-09 11:20 ` [Bug network/27835] " schwab@linux-m68k.org
@ 2021-05-29  9:12 ` fweimer at redhat dot com
  2021-05-31  7:42 ` wharms at bfs dot de
  2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2021-05-29  9:12 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27835

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
              Flags|                            |security-
                 CC|                            |fweimer at redhat dot com
         Resolution|---                         |INVALID

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
As Andreas wrote, this is the expected output format.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug network/27835] inet_nsap_ntoa() strange output
  2021-05-09 10:38 [Bug network/27835] New: inet_nsap_ntoa() strange output wharms at bfs dot de
  2021-05-09 11:20 ` [Bug network/27835] " schwab@linux-m68k.org
  2021-05-29  9:12 ` fweimer at redhat dot com
@ 2021-05-31  7:42 ` wharms at bfs dot de
  2 siblings, 0 replies; 4+ messages in thread
From: wharms at bfs dot de @ 2021-05-31  7:42 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27835

--- Comment #3 from walter <wharms at bfs dot de> ---
who is the user of inet_nsap_ntoa() ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-31  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-09 10:38 [Bug network/27835] New: inet_nsap_ntoa() strange output wharms at bfs dot de
2021-05-09 11:20 ` [Bug network/27835] " schwab@linux-m68k.org
2021-05-29  9:12 ` fweimer at redhat dot com
2021-05-31  7:42 ` wharms at bfs dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).