Page MenuHomeFreeBSD

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

Authored by bms on Sun, Aug 2, 1:15 PM.
Tags
None
Referenced Files
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
Unknown Object (File)
Fri, Aug 21, 9:36 AM
Unknown Object (File)
Thu, Aug 20, 3:04 AM
Unknown Object (File)
Mon, Aug 17, 5:05 AM
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.Sun, Aug 2, 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.