If ifchd interactions fail, terminate.

Ideally we would pause and resume state, but for now just bail out.
If ndhc is process-supervised, it will recover to the proper state
quickly.
This commit is contained in:
Nicholas J. Kain
2015-02-14 20:47:14 -05:00
parent 170f87c0e7
commit 5b82be8b00
4 changed files with 30 additions and 10 deletions

View File

@ -435,8 +435,10 @@ static void ndhc_main(void) {
memset(chroot_dir, '\0', sizeof chroot_dir);
nk_set_uidgid(ndhc_uid, ndhc_gid, NULL, 0);
if (cs.ifsPrevState != IFS_UP)
ifchange_deconfig(&cs);
if (cs.ifsPrevState != IFS_UP) {
if (ifchange_deconfig(&cs) < 0)
suicide("%s: can't deconfigure interface settings", __func__);
}
do_ndhc_work();
}