开发者

using libnet to send ARP request, but arp cache won't update after getting the ARP reply

开发者 https://www.devze.com 2023-01-09 03:00 出处:网络
I need to look开发者_Python百科 up MAC address in the local network and I\'m using Linux. What I do is send a ARP request with libnet, but after I send 3 requests, the cache still won\'t update. I use

I need to look开发者_Python百科 up MAC address in the local network and I'm using Linux. What I do is send a ARP request with libnet, but after I send 3 requests, the cache still won't update. I use wireshark to catch the packets. From wireshark, I did get 3 ARP replays, after each of my ARP request. Does anyone know how come the ARP cache won't update?


The Linux kernel does not accept unsolicited ARP by default. Since the request was sent by your userspace application and not by the kernel, the kernel sees the reply as "unsolicited".

You can change this default in /proc/sys/net/ipv4/conf/*/arp_accept (either on a per-device basis or across all devices).

0

精彩评论

暂无评论...
验证码 换一张
取 消