diff options
author | yar <yar@FreeBSD.org> | 2006-01-30 13:37:34 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-01-30 13:37:34 +0000 |
commit | a388ebb962934fe140e9559cc12ca537afae2187 (patch) | |
tree | 884bdb91a4a187a5ba71572aa4da23ad7441f699 /sbin/ifconfig/ifconfig.c | |
parent | 655acdb819a666ccccbc966d56bb47c97269f44a (diff) | |
download | FreeBSD-src-a388ebb962934fe140e9559cc12ca537afae2187.zip FreeBSD-src-a388ebb962934fe140e9559cc12ca537afae2187.tar.gz |
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
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index ee0f066..9c6efe5 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -535,6 +535,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. */ if (clearaddr) { @@ -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); } |