diff options
author | Roy Marples <uberlord@gentoo.org> | 2006-09-07 19:53:36 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2006-09-07 19:53:36 +0000 |
commit | 3eccef7ce956029f239085f33b58a655e2960fb2 (patch) | |
tree | 8a4b4f5fc99083170623d5cfcd69297bed89bf7d /net-misc/dhcp/files | |
parent | Mask dhcp alpha version (diff) | |
download | gentoo-2-3eccef7ce956029f239085f33b58a655e2960fb2.tar.gz gentoo-2-3eccef7ce956029f239085f33b58a655e2960fb2.tar.bz2 gentoo-2-3eccef7ce956029f239085f33b58a655e2960fb2.zip |
New alpha version. Has FQDN support, wooooo.
(Portage version: 2.1.1_rc1-r6)
Diffstat (limited to 'net-misc/dhcp/files')
-rw-r--r-- | net-misc/dhcp/files/dhcp-3.1.0a1-dhclient-resolvconf.patch | 254 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-3.1.0a1-x-option.patch | 223 | ||||
-rw-r--r-- | net-misc/dhcp/files/digest-dhcp-3.1.0_alpha1 | 3 |
3 files changed, 480 insertions, 0 deletions
diff --git a/net-misc/dhcp/files/dhcp-3.1.0a1-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-3.1.0a1-dhclient-resolvconf.patch new file mode 100644 index 000000000000..2baaa78418e6 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-3.1.0a1-dhclient-resolvconf.patch @@ -0,0 +1,254 @@ +diff -ur client.orig/scripts/bsdos client/scripts/bsdos +--- client.orig/scripts/bsdos 2006-09-07 18:53:10.476329752 +0100 ++++ client/scripts/bsdos 2006-09-07 19:19:53.000000000 +0100 +@@ -1,21 +1,22 @@ + #!/bin/sh + + make_resolv_conf() { +- if [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- if [ "x$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ "x$new_domain_name" != x ]; then +- # Note that the DHCP 'Domain Name Option' is really just a domain +- # name, and that this practice of using the domain name option as +- # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then ++ if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then ++ conf="# Generated by dhclient for interface $interface\n" ++ if [ "x$new_domain_name" != x ]; then ++ conf="${conf}search $new_domain_name\n" ++ fi ++ for nameserver in $new_domain_name_servers; do ++ conf="${conf}nameserver $nameserver\n" ++ done ++ if [ -x /sbin/resolvconf ]; then ++ echo -e "$conf" | resolvconf -a "$interface" ++ else ++ echo -e "$conf" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi +- for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >> /etc/resolv.conf.dhclient +- done +- +- mv /etc/resolv.conf.dhclient /etc/resolv.conf + fi + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf +diff -ur client.orig/scripts/freebsd client/scripts/freebsd +--- client.orig/scripts/freebsd 2006-09-07 18:53:10.476329752 +0100 ++++ client/scripts/freebsd 2006-09-07 19:19:32.000000000 +0100 +@@ -11,38 +11,20 @@ + fi + + make_resolv_conf() { +- if [ x"$new_domain_name_servers" != x ]; then +- ( cat /dev/null > /etc/resolv.conf.dhclient ) +- exit_status=$? +- if [ $exit_status -ne 0 ]; then +- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status" +- else +- if [ "x$new_domain_search" != x ]; then +- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient ) +- exit_status=$? +- elif [ "x$new_domain_name" != x ]; then +- # Note that the DHCP 'Domain Name Option' is really just a domain +- # name, and that this practice of using the domain name option as +- # a search path is both nonstandard and deprecated. +- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient ) +- exit_status=$? ++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then ++ if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then ++ conf="# Generated by dhclient for interface $interface\n" ++ if [ "x$new_domain_name" != x ]; then ++ conf="${conf}search $new_domain_name\n" + fi + for nameserver in $new_domain_name_servers; do +- if [ $exit_status -ne 0 ]; then +- break +- fi +- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient ) +- exit_status=$? ++ conf="${conf}nameserver $nameserver\n" + done +- +- # If there were no errors, attempt to mv the new file into place. +- if [ $exit_status -eq 0 ]; then +- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf ) +- exit_status = $? +- fi +- +- if [ $exit_status -ne 0 ]; then +- $LOGGER "Error while writing new /etc/resolv.conf." ++ if [ -x /sbin/resolvconf ]; then ++ echo -e "$conf" | resolvconf -a "$interface" ++ else ++ echo -e "$conf" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf + fi + fi + fi +diff -ur client.orig/scripts/linux client/scripts/linux +--- client.orig/scripts/linux 2006-09-07 18:53:10.476329752 +0100 ++++ client/scripts/linux 2006-09-07 19:18:57.000000000 +0100 +@@ -23,22 +23,22 @@ + # of the $1 in its args. + + make_resolv_conf() { +- if [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- chmod 644 /etc/resolv.conf.dhclient +- if [ x"$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ x"$new_domain_name" != x ]; then +- # Note that the DHCP 'Domain Name Option' is really just a domain +- # name, and that this practice of using the domain name option as +- # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then ++ if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then ++ conf="# Generated by dhclient for interface $interface\n" ++ if [ "x$new_domain_name" != x ]; then ++ conf="${conf}search $new_domain_name\n" ++ fi ++ for nameserver in $new_domain_name_servers; do ++ conf="${conf}nameserver $nameserver\n" ++ done ++ if [ -x /sbin/resolvconf ]; then ++ echo -e "$conf" | resolvconf -a "$interface" ++ else ++ echo -e "$conf" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi +- for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient +- done +- +- mv /etc/resolv.conf.dhclient /etc/resolv.conf + fi + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf +diff -ur client.orig/scripts/netbsd client/scripts/netbsd +--- client.orig/scripts/netbsd 2006-09-07 18:53:10.476329752 +0100 ++++ client/scripts/netbsd 2006-09-07 19:20:10.000000000 +0100 +@@ -1,21 +1,22 @@ + #!/bin/sh + + make_resolv_conf() { +- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- if [ "x$new_domain_search != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ "x$new_domain_name != x ]; then +- # Note that the DHCP 'Domain Name Option' is really just a domain +- # name, and that this practice of using the domain name option as +- # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then ++ if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then ++ conf="# Generated by dhclient for interface $interface\n" ++ if [ "x$new_domain_name" != x ]; then ++ conf="${conf}search $new_domain_name\n" ++ fi ++ for nameserver in $new_domain_name_servers; do ++ conf="${conf}nameserver $nameserver\n" ++ done ++ if [ -x /sbin/resolvconf ]; then ++ echo -e "$conf" | resolvconf -a "$interface" ++ else ++ echo -e "$conf" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi +- for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient +- done +- +- mv /etc/resolv.conf.dhclient /etc/resolv.conf + fi + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf +diff -ur client.orig/scripts/openbsd client/scripts/openbsd +--- client.orig/scripts/openbsd 2006-09-07 18:53:10.476329752 +0100 ++++ client/scripts/openbsd 2006-09-07 19:20:38.000000000 +0100 +@@ -1,21 +1,22 @@ + #!/bin/sh + + make_resolv_conf() { +- if x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- if [ x"$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ x"$new_domain_name" != x ]; then +- # Note that the DHCP 'Domain Name Option' is really just a domain +- # name, and that this practice of using the domain name option as +- # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then ++ if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then ++ conf="# Generated by dhclient for interface $interface\n" ++ if [ "x$new_domain_name" != x ]; then ++ conf="${conf}search $new_domain_name\n" ++ fi ++ for nameserver in $new_domain_name_servers; do ++ conf="${conf}nameserver $nameserver\n" ++ done ++ if [ -x /sbin/resolvconf ]; then ++ echo -e "$conf" | resolvconf -a "$interface" ++ else ++ echo -e "$conf" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi +- for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient +- done +- +- mv /etc/ersolv.conf.dhclient /etc/resolv.conf + fi + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf +diff -ur client.orig/scripts/solaris client/scripts/solaris +--- client.orig/scripts/solaris 2006-09-07 18:53:10.476329752 +0100 ++++ client/scripts/solaris 2006-09-07 19:21:12.000000000 +0100 +@@ -1,21 +1,22 @@ + #!/bin/sh + + make_resolv_conf() { +- if [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- if [ x"$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ x"$new_domain_name" != x ]; then +- # Note that the DHCP 'Domain Name Option' is really just a domain +- # name, and that this practice of using the domain name option as +- # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then ++ if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then ++ conf="# Generated by dhclient for interface $interface\n" ++ if [ "x$new_domain_name" != x ]; then ++ conf="${conf}search $new_domain_name\n" ++ fi ++ for nameserver in $new_domain_name_servers; do ++ conf="${conf}nameserver $nameserver\n" ++ done ++ if [ -x /sbin/resolvconf ]; then ++ echo -e "$conf" | resolvconf -a "$interface" ++ else ++ echo -e "$conf" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi +- for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient +- done +- +- mv /etc/resolv.conf.dhclient /etc/resolv.conf + fi + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf diff --git a/net-misc/dhcp/files/dhcp-3.1.0a1-x-option.patch b/net-misc/dhcp/files/dhcp-3.1.0a1-x-option.patch new file mode 100644 index 000000000000..8728e0ced490 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-3.1.0a1-x-option.patch @@ -0,0 +1,223 @@ +diff -ur client.orig/dhclient.8 client/dhclient.8 +--- client.orig/dhclient.8 2006-09-07 19:24:17.756460024 +0100 ++++ client/dhclient.8 2006-09-07 19:24:52.000000000 +0100 +@@ -85,6 +85,9 @@ + .B -w + ] + [ ++.B -x ++] ++[ + .I if0 + [ + .I ...ifN +@@ -268,6 +271,10 @@ + supplying the + .B -nw + flag. ++.PP ++The -x argument enables eXtended option information to be created in the ++-s dhclient-script environment, which would allow applications running ++in that environment to handle options they do not know about in advance. + .SH CONFIGURATION + The syntax of the dhclient.conf(5) file is discussed separately. + .SH OMAPI +diff -ur client.orig/dhclient.c client/dhclient.c +--- client.orig/dhclient.c 2006-09-07 19:24:17.756460024 +0100 ++++ client/dhclient.c 2006-09-07 19:24:52.000000000 +0100 +@@ -74,7 +74,9 @@ + int onetry=0; + int quiet=0; + int nowait=0; +- ++#ifdef EXTENDED_NEW_OPTION_INFO ++int extended_option_environment = 0; ++#endif + static void usage PROTO ((void)); + + void do_release(struct client_state *); +@@ -211,6 +213,11 @@ + } else if (!strcmp (argv [i], "--version")) { + log_info ("isc-dhclient-%s", DHCP_VERSION); + exit (0); ++#ifdef EXTENDED_NEW_OPTION_INFO ++ } else if (!strcmp (argv [i], "-x")) { ++ extended_option_environment = 1; ++ new_option_info_tree = GENERATE_NEW_OPTION_INFO; ++#endif + } else if (argv [i][0] == '-') { + usage (); + } else { +@@ -483,7 +490,11 @@ + log_info (arr); + log_info (url); + ++#ifdef EXTENDED_NEW_OPTION_INFO ++ log_error ("Usage: dhclient [-1dqr] [-nwx] [-p <port>] %s", ++#else + log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s", ++#endif + "[-s server]"); + log_error (" [-cf config-file] [-lf lease-file]%s", + "[-pf pid-file] [-e VAR=val]"); +@@ -2479,8 +2490,28 @@ + struct envadd_state { + struct client_state *client; + const char *prefix; ++ struct universe *universe; + }; + ++#ifdef EXTENDED_NEW_OPTION_INFO ++static ++void build_universe_info_envvar ++( struct option_cache *oc, ++ struct packet *p, struct lease *l, ++ struct client_state *client, ++ struct option_state *in_o, ++ struct option_state *cf_o, ++ struct binding_scope **scope, ++ struct universe *u, void *es ++) ++{ ++ char info_name[512], info_data[512]; ++ snprintf(info_name, 512, "%s._universe_.", oc->option->universe->name); ++ snprintf(info_data, 512, "%u:%s", oc->option->code,oc->option->format); ++ client_envadd( client, info_name, oc->option->name, info_data ); ++} ++#endif ++ + void client_option_envadd (struct option_cache *oc, + struct packet *packet, struct lease *lease, + struct client_state *client_state, +@@ -2497,6 +2528,31 @@ + in_options, cfg_options, scope, oc, MDL)) { + if (data.len) { + char name [256]; ++#ifdef EXTENDED_NEW_OPTION_INFO ++ if ( extended_option_environment ) ++ { ++ if( ( oc->option->universe != &dhcp_universe ) ++ &&( oc->option->universe->index > fqdn_universe.index ) ++ &&( es->universe != oc->option->universe ) ++ ) ++ { ++ es->universe = oc->option->universe; ++ (*(es->universe->foreach)) ++ ( (struct packet *)0, (struct lease *)0, ++ client_state, ++ in_options, cfg_options, ++ scope, es->universe, es, ++ build_universe_info_envvar ++ ); ++ }else ++ if ( lookup_new_option_info(oc->option) != 0L ) ++ build_universe_info_envvar ++ ( oc, packet, lease, client_state, ++ in_options, cfg_options, scope, ++ oc->option->universe, es ++ ); ++ } ++#endif + if (dhcp_option_ev_name (name, sizeof name, + oc -> option)) { + client_envadd (es -> client, es -> prefix, +@@ -2525,6 +2581,7 @@ + + es.client = client; + es.prefix = prefix; ++ es.universe = 0L; + + client_envadd (client, + prefix, "ip_address", "%s", piaddr (lease -> address)); +@@ -2736,7 +2793,14 @@ + s = option -> name; + if (j + 1 == buflen) + return 0; ++#ifdef EXTENDED_NEW_OPTION_INFO ++ if ( ! extended_option_environment ) ++ buf [j++] = '_'; ++ else ++ buf [j++] = '.'; ++#else + buf [j++] = '_'; ++#endif + } + ++i; + } while (i != 2); +diff -ur /tmp/dhcp-3.1.0a1/common/parse.c ./common/parse.c +--- /tmp/dhcp-3.1.0a1/common/parse.c 2006-09-07 19:24:17.753460480 +0100 ++++ ./common/parse.c 2006-09-07 19:27:18.000000000 +0100 +@@ -1566,6 +1566,10 @@ + option, MDL); + option_name_hash_add(option->universe->name_hash, option->name, 0, + option, MDL); ++#ifdef EXTENDED_NEW_OPTION_INFO ++ if (new_option_info_tree != 0L) ++ add_new_option_info(option); ++#endif + return 1; + } + +Only in ./common: parse.c.orig +diff -ur /tmp/dhcp-3.1.0a1/common/tables.c ./common/tables.c +--- /tmp/dhcp-3.1.0a1/common/tables.c 2006-09-07 19:24:17.754460328 +0100 ++++ ./common/tables.c 2006-09-07 19:24:52.000000000 +0100 +@@ -887,3 +887,40 @@ + universe_hash_add(universe_hash, isc_universe.name, 0, + &isc_universe, MDL); + } ++ ++#ifdef EXTENDED_NEW_OPTION_INFO ++#include <search.h> ++ ++void *new_option_info_tree = 0L; ++ ++static int new_option_info_comparator( const void* p1, const void *p2 ) ++{ ++ uint32_t ocode1 = (((const struct option*)p1)->universe->index << 8) ++ |(((const struct option*)p1)->code), ++ ocode2 = (((const struct option*)p2)->universe->index << 8) ++ |(((const struct option*)p2)->code); ++ return( (ocode1 == ocode2) ++ ? 0 ++ :( ( ocode1 > ocode2 ) ++ ? 1 ++ : -1 ++ ) ++ ); ++} ++ ++void *add_new_option_info( struct option *option ) ++{ ++ if ( option->universe->index >= fqdn_universe.index ) ++ return 0L; ++ if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO ) ++ new_option_info_tree = (void*)0L; ++ return tsearch( option, &(new_option_info_tree), new_option_info_comparator ); ++} ++ ++void *lookup_new_option_info( struct option *option ) ++{ ++ if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO ) ++ return 0L; ++ return tfind( option, &(new_option_info_tree), new_option_info_comparator ); ++} ++#endif +Only in ./common: tables.c.orig +diff -ur /tmp/dhcp-3.1.0a1/includes/dhcpd.h ./includes/dhcpd.h +--- /tmp/dhcp-3.1.0a1/includes/dhcpd.h 2006-09-07 19:24:17.831448624 +0100 ++++ ./includes/dhcpd.h 2006-09-07 19:24:52.000000000 +0100 +@@ -1938,6 +1938,13 @@ + void initialize_common_option_spaces PROTO ((void)); + struct universe *config_universe; + ++#ifdef EXTENDED_NEW_OPTION_INFO ++#define GENERATE_NEW_OPTION_INFO ((void*)1) ++extern void *new_option_info_tree; ++extern void *add_new_option_info( struct option*); ++extern void *lookup_new_option_info( struct option *); ++#endif ++ + /* stables.c */ + #if defined (FAILOVER_PROTOCOL) + extern failover_option_t null_failover_option; diff --git a/net-misc/dhcp/files/digest-dhcp-3.1.0_alpha1 b/net-misc/dhcp/files/digest-dhcp-3.1.0_alpha1 new file mode 100644 index 000000000000..3b3d805f94ee --- /dev/null +++ b/net-misc/dhcp/files/digest-dhcp-3.1.0_alpha1 @@ -0,0 +1,3 @@ +MD5 a326c6f135b9fa3ad24988312c784be5 dhcp-3.1.0a1.tar.gz 773828 +RMD160 4ededc197e668219d404a054816cd48e71ac8a39 dhcp-3.1.0a1.tar.gz 773828 +SHA256 80f610a6bdfe2ac2d2dd50886d903217141c2983c1a22af23fb223998769651b dhcp-3.1.0a1.tar.gz 773828 |