/[gentoo-x86]/net-misc/networkmanager/files/networkmanager-0.8.1-dhclient3.patch
Gentoo

Contents of /net-misc/networkmanager/files/networkmanager-0.8.1-dhclient3.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Aug 23 23:17:09 2011 UTC (2 years, 10 months ago) by nirbheek
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Bump for the 0.9.0 release, go forth and test. Also, remove old ebuilds and unused patches.

(Portage version: 2.2.0_alpha51/cvs/Linux x86_64)

1 From d39fda772235d967266a25159b877596d636c048 Mon Sep 17 00:00:00 2001
2 From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
3 Date: Thu, 12 Aug 2010 22:52:20 +0000
4 Subject: dhcp: don't fail with dhclient v3
5
6 ---
7 diff --git a/configure.ac b/configure.ac
8 index cfc2122..efdef27 100644
9 --- a/configure.ac
10 +++ b/configure.ac
11 @@ -319,21 +319,30 @@ AC_SUBST(PPPD_PLUGIN_DIR)
12 AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support]))
13 # If a full path is given, use that and do not test if it works or not.
14 case "${with_dhclient}" in
15 + # NM only works with ISC dhclient - other derivatives don't have
16 + # the same userland. dhclient 4.x is required for IPv6 support;
17 + # with older versions NM won't be able to use DHCPv6.
18 +
19 /*)
20 DHCLIENT_PATH="${with_dhclient}"
21 + DHCLIENT_VERSION=4
22 + if test -x "${with_dhclient}"; then
23 + case `"${with_dhclient}" --version 2>&1` in
24 + "isc-dhclient-4"*) DHCLIENT_VERSION=4; break;;
25 + "isc-dhclient-V3"*) DHCLIENT_VERSION=3; break;;
26 + esac
27 + fi
28 AC_MSG_NOTICE(using dhclient at ${DHCLIENT_PATH})
29 ;;
30 no) AC_MSG_NOTICE(dhclient support disabled)
31 ;;
32 *)
33 AC_MSG_CHECKING(for dhclient)
34 - # NM only works with ISC dhclient - other derivatives don't have
35 - # the same userland. NM also requires dhclient 4.x since older
36 - # versions do not have IPv6 support.
37 for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do
38 test -x "${path}/dhclient" || continue
39 case `"$path/dhclient" --version 2>&1` in
40 - "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; break;;
41 + "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; DHCLIENT_VERSION=4; break;;
42 + "isc-dhclient-V3"*) DHCLIENT_PATH="$path/dhclient"; DHCLIENT_VERSION=3; break;;
43 esac
44 done
45 if test -n "${DHCLIENT_PATH}"; then
46 @@ -554,6 +563,7 @@ echo
47
48 if test -n "${DHCLIENT_PATH}"; then
49 echo ISC dhclient support: ${DHCLIENT_PATH}
50 + echo ISC dhclient version: ${DHCLIENT_VERSION}
51 else
52 echo ISC dhclient support: no
53 fi
54 diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am
55 index f75e6b3..4c54087 100644
56 --- a/src/dhcp-manager/Makefile.am
57 +++ b/src/dhcp-manager/Makefile.am
58 @@ -29,6 +29,7 @@ libdhcp_manager_la_CPPFLAGS = \
59 -DLIBEXECDIR=\"$(libexecdir)\" \
60 -DLOCALSTATEDIR=\"$(localstatedir)\" \
61 -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \
62 + -DDHCLIENT_V$(DHCLIENT_VERSION) \
63 -DDHCPCD_PATH=\"$(DHCPCD_PATH)\"
64
65 libdhcp_manager_la_LIBADD = \
66 diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c
67 index cae7df2..13caa02 100644
68 --- a/src/dhcp-manager/nm-dhcp-dhclient.c
69 +++ b/src/dhcp-manager/nm-dhcp-dhclient.c
70 @@ -45,7 +45,11 @@ G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT)
71 #define NM_DHCP_DHCLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientPrivate))
72
73 #if defined(TARGET_DEBIAN) || defined(TARGET_SUSE) || defined(TARGET_MANDRIVA)
74 +#if defined(DHCLIENT_V3)
75 +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp3"
76 +#else
77 #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp"
78 +#endif
79 #else
80 #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhclient"
81 #endif
82 @@ -437,7 +441,11 @@ create_dhclient_config (const char *iface,
83 #if defined(TARGET_SUSE)
84 orig = g_strdup (SYSCONFDIR "/dhclient.conf");
85 #elif defined(TARGET_DEBIAN) || defined(TARGET_GENTOO)
86 +#if defined(DHCLIENT_V3)
87 + orig = g_strdup (SYSCONFDIR "/dhcp3/dhclient.conf");
88 +#else
89 orig = g_strdup (SYSCONFDIR "/dhcp/dhclient.conf");
90 +#endif
91 #else
92 orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", iface);
93 #endif
94 @@ -499,12 +507,20 @@ dhclient_start (NMDHCPClient *client,
95 guint log_domain;
96
97 g_return_val_if_fail (priv->pid_file == NULL, -1);
98 - g_return_val_if_fail (ip_opt != NULL, -1);
99
100 iface = nm_dhcp_client_get_iface (client);
101 uuid = nm_dhcp_client_get_uuid (client);
102 ipv6 = nm_dhcp_client_get_ipv6 (client);
103
104 +#if defined(DHCLIENT_V3)
105 + if (ipv6) {
106 + nm_log_warn (log_domain, "(%s): ISC dhcp3 does not support IPv6", iface);
107 + return -1;
108 + }
109 +#else
110 + g_return_val_if_fail (ip_opt != NULL, -1);
111 +#endif
112 +
113 log_domain = ipv6 ? LOGD_DHCP6 : LOGD_DHCP4;
114
115 priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient%s-%s.pid",
116 @@ -536,10 +552,11 @@ dhclient_start (NMDHCPClient *client,
117
118 g_ptr_array_add (argv, (gpointer) "-d");
119
120 +#if !defined(DHCLIENT_V3)
121 g_ptr_array_add (argv, (gpointer) ip_opt);
122 -
123 if (mode_opt)
124 g_ptr_array_add (argv, (gpointer) mode_opt);
125 +#endif
126
127 g_ptr_array_add (argv, (gpointer) "-sf"); /* Set script file */
128 g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH );
129 --

  ViewVC Help
Powered by ViewVC 1.1.20