arp: Don't send gratuitous ARP in arp_ifinit
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 28 Feb 2012 12:57:57 +0000 (20:57 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 28 Feb 2012 13:28:08 +0000 (21:28 +0800)
commit69b66ae83cb218bcdc1c4c16e75a10e206906901
tree65dba1b7680c5cdcb980c2f6a73b952baeb6c1d4
parent7ade6f58869ca239bea7d1388b9f1877b12d595e
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.
sys/net/if.c
sys/netinet/if_ether.c
sys/netinet/if_ether.h
sys/netinet/ip_carp.c