我在ifconfig -a - HWaddr 00:1a:92:9c:9b:bb中找到了网络设备的MAC地址
如何在我的代码中与此地址相关?
struct ethhdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
__be16 h_proto; /* packet type ID field */
} __attribute__((packed));我正在努力给h_dest写信
memcpy(eth->h_dest,dest_mac,ETH_ALEN);但我不知道必须以什么顺序传递MAC-address值的字节和位。
发布于 2012-11-12 18:27:16
它们应该是从左到右的顺序,所以h_dest[0] = 0x00。
https://stackoverflow.com/questions/13341645
复制相似问题