vps-net_add: fix sending ARP if NEIGHBOUR_DEVS=detect

Function vz_get_neighbour_devs returns empty list in function vzarpipset.
Because of that, when adding IP address to CT, gratuitous ARP (arpsend -U)
isn't sent out, and neighbors' ARP caches aren't updated.

This is because of how vz_get_neighbour_devs works (ip route get...), and order
of calling functions vzaddrouting and vzarpipset in vps-net_add.

Example adding new IP (192.168.32.100) address to CT:

----------------------------------------------------
- routes before adding:
--------------
192.168.32.5 dev venet0  scope link
192.168.32.0/24 dev eth0  proto kernel  scope link  src 192.168.32.2
default via 192.168.32.1 dev eth0
--------------

in vps-net_add:

vzgetnetdev -> NETDEVICES=eth0

- vz_get_neighbour_devs in vzarpipdetect and vzarp returns eth0 as it should
    'ip route get 192.168.32.100' returns:
        192.168.32.100 dev eth0  src 192.168.32.2
- then 'vzaddrouting 192.168.32.100' is executed, and routes are:
    --------------
    192.168.32.5 dev venet0  scope link
    192.168.32.100 dev venet0  scope link
    192.168.32.0/24 dev eth0  proto kernel  scope link  src 192.168.32.2
    default via 192.168.32.1 dev eth0
    --------------
- now vz_get_neighbour_devs in vzarpipset returns empty list, because
  'ip route get 192.168.32.100' returns:
        192.168.32.100 dev venet0  src 192.168.32.2
  as it should; venet0 isn't in NETDEVICES and empty list is returned
----------------------------------------------------

One possible solution is to call 'arpsend -U...' in function vzarp, before host
route for new IP address is added, as in this patch.

http://bugzilla.openvz.org/1344
2 files changed