我试图从内核中生成arp请求,但我不明白“目标MAC地址”和“目标MAC地址”之间的区别。我使用的内核函数是这样的:
void arp_send(int type, int ptype, __be32 dest_ip,
struct net_device *dev, __be32 src_ip,
const unsigned char *dest_hw, const unsigned char *src_hw,
const unsigned char *target_hw)有人知道'target_hw‘(目标MAC地址)和'dst_hw’(目的MAC地址)之间的区别吗?对我来说它们应该是一样的..。
发布于 2013-01-12 17:41:50
ARP函数是一个通用函数,用于发送arp_send请求和响应。
在您的情况下(ARP请求),target_hw是您想要学习的信息,因此可以忽略此字段(设置为NULL,参见RFC826示例) dest_hw也将为NULL -这将导致使用广播地址(参见arp_create comment)
我在这里假设是以太网上的IPv4。对于其他Layer2/3协议,它可能看起来不同。
https://stackoverflow.com/questions/14280719
复制相似问题