diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index ee0f0666247e..9c6efe58bfb8 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -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); }