git: arp: Don't send gratuitous ARP in arp_ifinit

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Tue Feb 28 05:41:27 PST 2012


commit 69b66ae83cb218bcdc1c4c16e75a10e206906901
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Tue Feb 28 20:57:57 2012 +0800

    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.

Summary of changes:
 sys/net/if.c           |    2 +-
 sys/netinet/if_ether.c |   45 ++++++++++++++++++++++++++++++---------------
 sys/netinet/if_ether.h |    2 +-
 sys/netinet/ip_carp.c  |    4 ++--
 4 files changed, 34 insertions(+), 19 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/69b66ae83cb218bcdc1c4c16e75a10e206906901


-- 
DragonFly BSD source repository





More information about the Commits mailing list