arp: Don't send gratuitous ARP in arp_ifinit
- Move the CARP's ifaddr_event handler to the first of the
registered ifaddr_event handlers.
- Register ifaddr_event handler for gratuituous ARP; it won't
send gratuitous ARP for CARP interface or CARP interface's
parent. The event handler is registered as the last
ifaddr_event handler, so it is called after CARP's ifaddr_event
handler. It is mainly used to fix following problem before
this commit:
ifconfig emx0 up
ifconfig carp0 create
ifconfig carp0 vhid 1
ifconfig carp0 inet 192.168.3.2
ifconfig emx0 inet 192.168.3.2
Originally, you always saw gratuitous ARP from emx0 first,
then gratuitous ARP from carp0, which is quite confusing.
After this change, only gratuitous ARP from carp0.
- arp_ifinit() now only set ifa_rtrequest and CLONING flags
- Rename arp_iainit() to arp_gratuitous(); call it when CARP
wants to send gratuitous ARP and when link layer address
is changed.