我正在通过 iOS 中的套接字发送 ICMP 数据包:
struct sockaddr hostAddress;
self->hostAddress.sa_family = AF_INET;
inet_pton(AF_INET, "173.194.67.93", &self->hostAddress.sa_data);
然后,我打开套接字并发送数据包:
bytesSent = sendto(
CFSocketGetNative(self->_socket),
[packet bytes],
[packet length],
0,
&self->hostAddress,
sizeof(self->hostAddress)
);
当我在 WireShark 中看到数据包时,它被发送到“67.93.0.0”,而不是“173.194.67.93”。
问题可能出在哪里?