diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-07 20:14:47 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-07 20:14:47 +0000 |
commit | b4045f6c18e8d4e5c8198e0e53fa1d983bd9cbb0 (patch) | |
tree | 545e9c17a631cf3f87e02b2f13ee3d2de423ff05 /sbin | |
parent | dc49df34a5b711a13a375fc29635991abdb9466f (diff) |
since we removed all the multiple interfaces crap, we now need a lease
file per interface, and not one for all. Use /var/db/dhclient.leases.IFNAME
discussed with pb@ quite some time ago, ok tdeval@ beck@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index e11850a6e29..00212c0ffdb 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.31 2004/03/05 23:57:16 deraadt Exp $ */ +/* $OpenBSD: dhclient.c,v 1.32 2004/04/07 20:14:46 henning Exp $ */ /* DHCP Client. */ @@ -78,7 +78,7 @@ time_t max_lease_time = 86400; /* 24 hours... */ struct tree_cache *global_options[256]; char *path_dhclient_conf = _PATH_DHCLIENT_CONF; -char *path_dhclient_db = _PATH_DHCLIENT_DB; +char *path_dhclient_db; int log_perror = 1; @@ -246,7 +246,11 @@ main(int argc, char *argv[]) if ((ifi = calloc(1, sizeof(struct interface_info))) == NULL) error("calloc"); - strlcpy(ifi->name, argv[0], IFNAMSIZ); + if (strlcpy(ifi->name, argv[0], IFNAMSIZ) >= IFNAMSIZ) + error("Interface name too long"); + if (asprintf(&path_dhclient_db, "%s.%s", _PATH_DHCLIENT_DB, + ifi->name) == -1) + error("asprintf"); if (quiet) log_perror = 0; |