Correctly state the link state to INVALID when creating a carp interface.
authormpi <mpi@openbsd.org>
Thu, 21 May 2015 09:17:53 +0000 (09:17 +0000)
committermpi <mpi@openbsd.org>
Thu, 21 May 2015 09:17:53 +0000 (09:17 +0000)
commit6f5c556f471f5e2ef3c4b71c9c49bd7111fb84a1
treee63264f6fae1b752e26c3859b952f19181f3e9a4
parent1eee5089159717c30380898f5c79428e78029e93
Correctly state the link state to INVALID when creating a carp interface.

Since vhe are allocated with M_ZERO and INIT is also defined to be 0,
carp_set_state() would result in a no-op because of the state check.

So explicitly initialize the state of a vhe to INIT and move the state
check in carp_set_state_all() to prevent similar issues in the future.

Problem and initial diff from Johan Ymerson, thanks!

ok henning@
sys/netinet/ip_carp.c