Do address assignment/removal operations after callbacks.

Presently, ifconfig callbacks are used for L2 configuration, media
and vlan, so actions associated with address assignment, like sending
out a gratuitous ARP, should go when L2 is running already.

This also should fix the problem with setting up vlan interfaces
from rc.conf, when both IP and vlan+vlandev parameters are passed
to ifconfig at once.

Future work: Consider introducing several ifconfig callback lists
to invoke callbacks orderly.

MFC after:	1 week
This commit is contained in:
yar 2006-01-30 13:37:34 +00:00
parent 655acdb819
commit a388ebb962

View File

@ -534,6 +534,12 @@ ifconfig(int argc, char *const *argv, const struct afswtch *afp)
*/
if (afp->af_postproc != NULL)
afp->af_postproc(s, afp);
/*
* Do deferred callbacks registered while processing
* command-line arguments.
*/
for (cb = callbacks; cb != NULL; cb = cb->cb_next)
cb->cb_func(s, cb->cb_arg);
/*
* Do deferred operations.
*/
@ -568,13 +574,6 @@ ifconfig(int argc, char *const *argv, const struct afswtch *afp)
Perror("ioctl (SIOCAIFADDR)");
}
/*
* Do deferred callbacks registered while processing
* command-line arguments.
*/
for (cb = callbacks; cb != NULL; cb = cb->cb_next)
cb->cb_func(s, cb->cb_arg);
close(s);
return(0);
}