Don't reflect CARP's internal state via IFF_UP (which a user can modify), use IFF_RUNNING instead.  Also, do not blindly restore flags onto an interface when returning to the running state.
Don't reflect CARP's internal state via IFF_UP (which a user can modify), use
IFF_RUNNING instead.  Also, do not blindly restore flags onto an interface when
returning to the running state.

This eliminates the possibility that the kernel will bring the interface back
up after a link state change on the physical interface, even though the user
may have done an "ifconfig carpN down" in the meantime.  Similarly two link
state down events on the physical interface in succession could result in us
never coming out of the INIT state.

The master/backup state is still reported via link state information, so
bgpd/ospfd, etc, should function as before.

This also addresses PR4238.

ok mpf@, ok with the idea etc henning@

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars