Page MenuHomeFreeBSD

mtest: Use ntohl() when assigning IPv4-mapped addresses for IPv6 sockets.
AbandonedPublic

Authored by bms on Aug 2 2026, 1:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 3, 5:56 PM
Unknown Object (File)
Thu, Sep 3, 2:37 AM
Unknown Object (File)
Tue, Sep 1, 7:22 AM
Unknown Object (File)
Thu, Aug 27, 3:34 PM
Unknown Object (File)
Thu, Aug 27, 12:51 PM
Unknown Object (File)
Sun, Aug 23, 10:09 PM
Unknown Object (File)
Sun, Aug 23, 12:16 AM
Unknown Object (File)
Fri, Aug 21, 9:08 PM
Subscribers

Details

Summary

Direct assignments to C integer array members are in host endianness,
so preserve network endianness of a value returned by getnameinfo().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75336
Build 72219: arc lint + arc unit

Event Timeline

bms requested review of this revision.Aug 2 2026, 1:15 PM
zlei added inline comments.
usr.sbin/mtest/mtest.c
162

Emm, the internet addresses ( in this case both a4 and a6 ) shall always be stored with network byte order. So is this extra ntohl really required ?

Good catch, this was being munged elsewhere. The ntohl() for the 0x0000FFFF component is definitely needed.