hostapd: iapp: deinitialize iapp sockets when interface down

When ifconfig br-lan down, IAPP routing socket will receive
RTM_DELADDR message. Fixed the issue of hostapd using 100%
cpu when not checking nlmsg_type, and handled the RTM_DELADDR
message by deinitializing iapp sockets.

BUG=b:32684984
TEST=Tested manually by observing debug message showing received
     nlmsg_type, and reproduced issue without fix. Verified
     issue is not reproducible with the fix. Steps to reproduce:
     1. Run below command in a serial console
     2. ps aux | grep hostapd ; make sure hostapd is running
     3. top ; verify hostapd using less than 10% CPU
     4. ap-configure --wan_connection_type=bridged
     5. ifconfig br-lan down
     6. top ; observe hostapd using greater than 90% CPU
     7. ifocnfig br-lan up
     8. ap-configure --lwan_connection_type=dhcp
     9. top ; observe hostapd using less than 10% CPU

Change-Id: I6a32308e6de86bbcc89a9d4e04f29393d361e99a
Reviewed-on: https://chromium-review.googlesource.com/408733
Commit-Ready: Hisham Yehia <hyehia@chromium.org>
Tested-by: Zhihong Yu <zhihongyu@chromium.org>
Reviewed-by: Srinivasa duvvuri <sduvvuri@chromium.org>
1 file changed