ifconfig: fix endianness bug displaying pfsync interfaces
Details
Details
ifconfig tun0 create
kldload pfsync
ifconfig pfsync syncdev tun0
ifconfig pfsync0 # Verify that peer address doesn't display
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sbin/ifconfig/ifpfsync.c | ||
---|---|---|
198 ↗ | (On Diff #53316) | I think that needs to be 'htonl()'. It'll work of course, but INADDR_PFSYNC_GROUP is in host byte order, and preq.pfsyncr_syncpeer.s_addr is in network order, so you want to go from host to network order, and not the other way around. |
sbin/ifconfig/ifpfsync.c | ||
---|---|---|
198 ↗ | (On Diff #53316) | Oh, my mistake. I saw the definition and read it as a byte array, ignoring the leading (in_addr_t) #define INADDR_PFSYNC_GROUP ((in_addr_t)0xe00000f0) /* 224.0.0.240 */ |