diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-01-23 04:46:00 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-01-23 04:46:00 +0000 |
commit | eb796682f008c4265a558ccfd7aac7770e5a3691 (patch) | |
tree | 6d7fd9a795666a8de3ccdc7469bb2d1befcc791d /sbin/dhclient/dhclient.c | |
parent | 5f26ec5c297c1f87d08c924404d1765d9a0dac52 (diff) |
Keep socket open from startup, and reuse for SIOCGIFFLAGS later on,
rather than opening a fresh socket on the fly.
ok krw
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r-- | sbin/dhclient/dhclient.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 48f5c21bf27..d4b2cd2b63e 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.393 2016/11/25 14:46:57 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.394 2017/01/23 04:45:59 deraadt Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -426,6 +426,8 @@ die: char **saved_argv; +int sock; + int main(int argc, char *argv[]) { @@ -439,7 +441,7 @@ main(int argc, char *argv[]) struct passwd *pw; char *ignore_list = NULL; ssize_t tailn; - int rtfilter, sock, tailfd; + int rtfilter, tailfd; saved_argv = argv; @@ -522,7 +524,6 @@ main(int argc, char *argv[]) memset(ifi->ssid, 0, sizeof(ifi->ssid)); memcpy(ifi->ssid, nwid.i_nwid, nwid.i_len); } - close(sock); /* Put us into the correct rdomain */ ifi->rdomain = get_rdomain(ifi->name); |