summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2010-06-02 09:57:17 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2010-06-02 09:57:17 +0000
commit0427b5aa560532d3c58c57c887e565b4fd7dceb5 (patch)
tree06ba08307ddbe62058f5ca72c09cc5a1250e2ea6 /sbin/dhclient/dhclient.c
parent13b1162ae35520b2ef563914fff32ea410a4a485 (diff)
Have dhclient obey the interface's rdomain, instead of doing routes on
rdomain 0. OK krw@, claudio@ sharp stick prodding from claudio@
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 5f5fae7b7c8..5c1926956ec 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.133 2010/03/25 18:37:36 stevesk Exp $ */
+/* $OpenBSD: dhclient.c,v 1.134 2010/06/02 09:57:16 phessler Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -336,6 +336,9 @@ main(int argc, char *argv[])
sockaddr_broadcast.sin_len = sizeof(sockaddr_broadcast);
inaddr_any.s_addr = INADDR_ANY;
+ /* Put us into the correct rdomain */
+ ifi->rdomain = get_rdomain(ifi->name);
+
read_client_conf();
if (interface_status(ifi->name) == 0) {
@@ -1589,6 +1592,8 @@ script_init(char *reason, struct string_list *medium)
void
priv_script_init(char *reason, char *medium)
{
+ char *rdomain;
+
client->scriptEnvsize = 100;
if (client->scriptEnv == NULL)
client->scriptEnv =
@@ -1604,6 +1609,12 @@ priv_script_init(char *reason, char *medium)
script_set_env("", "interface", ifi->name);
+ if (asprintf(&rdomain, "-T %d", ifi->rdomain) == -1)
+ error("script_init: no memory for environment");
+
+ script_set_env("", "rdomain", rdomain);
+ free(rdomain);
+
if (medium)
script_set_env("", "medium", medium);