diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-11-16 16:46:19 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-11-16 16:46:19 +0000 |
commit | 7bc3d929ea501183128c717258ee7af1e8f77f3f (patch) | |
tree | ee96f714aefd3e397e29a5e21eebba4c37701c05 /sbin/dhclient/dhclient.c | |
parent | 0ab08d2be8f9c240ab0547c7a5cdf8e439036571 (diff) |
Call discover_interface() before forking, so both processes will know
the interface index, hardware address, etc. as well as the interface
name.
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r-- | sbin/dhclient/dhclient.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 1da4fd047fd..fc2bfcc1d83 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.177 2012/11/15 14:54:18 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.178 2012/11/16 16:46:18 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -359,6 +359,9 @@ main(int argc, char *argv[]) if (pipe(pipe_fd) == -1) error("pipe"); + /* set up the interface */ + discover_interface(); + fork_privchld(pipe_fd[0], pipe_fd[1]); close(pipe_fd[0]); @@ -385,9 +388,6 @@ main(int argc, char *argv[]) sizeof(ifi->rdomain)) == -1) error("setsockopt(ROUTE_TABLEFILTER): %m"); - /* set up the interface */ - discover_interface(); - if (chroot(_PATH_VAREMPTY) == -1) error("chroot"); if (chdir("/") == -1) |