File dhcpcd-3.2.3-suse.diff of Package dhcpcd

--- dhcpcd-3.2.3/Makefile
+++ dhcpcd-3.2.3/Makefile
@@ -31,4 +31,4 @@
 	echo "#define VERSION \"${VERSION}\""> version.h
 
 .in:
-	sed 's:@PREFIX@:${PREFIX}:g; s:@INFODIR@:${INFOD}:g' $< > $@
+	sed 's#@PREFIX@#${PREFIX}#g; s#@INFODIR@#${INFOD}#g' $< > $@
--- dhcpcd-3.2.3/configure.c
+++ dhcpcd-3.2.3/configure.c
@@ -400,7 +400,7 @@
 
 #ifdef ENABLE_NIS
 #define PREFIXSIZE 256
-static int make_nis (const char *ifname, const dhcp_t *dhcp)
+static int make_nis (const char *ifname, const dhcp_t *dhcp, const options_t *options)
 {
 	FILE *f;
 	address_t *address;
@@ -417,7 +417,8 @@
 	fprintf (f, "# Generated by dhcpcd for interface %s\n", ifname);
 
 	if (dhcp->nisdomain) {
-		setdomainname (dhcp->nisdomain, (int) strlen (dhcp->nisdomain));
+                if( options->donisdom)
+			 setdomainname (dhcp->nisdomain, strlen (dhcp->nisdomain));
 
 		if (dhcp->nisservers)
 			snprintf (prefix, PREFIXSIZE, "domain %s server",
@@ -754,7 +755,7 @@
 
 #ifdef ENABLE_NIS
 	if (options->donis && (dhcp->nisservers || dhcp->nisdomain))
-		make_nis(iface->name, dhcp);
+		make_nis(iface->name, dhcp, options);
 #endif
 
 	curhostname = xmalloc (sizeof (char) * MAXHOSTNAMELEN);
--- dhcpcd-3.2.3/dhcpcd.8.in
+++ dhcpcd-3.2.3/dhcpcd.8.in
@@ -29,7 +29,7 @@
 .Nd an RFC 2131 compliant DHCP client
 .Sh SYNOPSIS
 .Nm
-.Op Fl dknpAEGHMLNRSTY
+.Op Fl dknpADEGHMLNRSTY
 .Op Fl c , -script Ar script
 .Op Fl h , -hostname Ar hostname
 .Op Fl i , -classid Ar classid
@@ -309,6 +309,8 @@
 Don't touch
 .Pa /etc/yp.conf
 or restart the ypbind service.
+.It Fl D , -nisdomain
+Forces dhcpcd to set domainname of the host to the domainname option supplied by DHCP server.
 .El
 .Sh NOTES
 Because
--- dhcpcd-3.2.3/dhcpcd.c
+++ dhcpcd-3.2.3/dhcpcd.c
@@ -71,6 +71,7 @@
 	{"userclass",   required_argument,  NULL, 'u'},
 	{"exit",        no_argument,        NULL, 'x'},
 	{"lastlease",   no_argument,        NULL, 'E'},
+	{"nonisdom",    no_argument,        NULL, 'D'},
 	{"fqdn",        required_argument,  NULL, 'F'},
 	{"nogateway",   no_argument,        NULL, 'G'},
 	{"sethostname", no_argument,        NULL, 'H'},
@@ -135,7 +136,7 @@
 
 static void usage (void)
 {
-	printf ("usage: "PACKAGE" [-adknpEGHMNRSTY] [-c script] [-h hostname] [-i classID]\n"
+	printf ("usage: "PACKAGE" [-adknpEGHKMNRSTYD] [-c script] [-h hostname] [-i classID]\n"
 		"              [-l leasetime] [-m metric] [-r ipaddress] [-s ipaddress]\n"
 		"              [-t timeout] [-u userclass] [-F none | ptr | both]\n"
 		"              [-I clientID] <interface>\n");
@@ -170,6 +171,7 @@
 	options->dodns = true;
 	options->domtu = true;
 	options->donis = true;
+	options->donisdom = false;
 	options->dontp = true;
 	options->dogateway = true;
 	options->daemonise = true;
@@ -186,7 +188,7 @@
 	/* Don't set any optional arguments here so we retain POSIX
 	 * compatibility with getopt */
 	while ((opt = getopt_long(argc, argv, EXTRA_OPTS
-				  "c:dh:i:kl:m:npr:s:t:u:xAEF:GHI:LMNRSTY",
+				  "c:dh:i:kl:m:npr:s:t:u:xAEF:GHI:LMNRSTYD",
 				  longopts, &option_index)) != -1)
 	{
 		switch (opt) {
@@ -408,6 +410,10 @@
 			case 'Y':
 				options->donis = false;
 				break;
+                        case 'D':
+                                options->donisdom = true;
+                                break;
+
 			case '?':
 				usage ();
 				goto abort;
--- dhcpcd-3.2.3/dhcpcd.h
+++ dhcpcd-3.2.3/dhcpcd.h
@@ -70,6 +70,7 @@
 	int  dohostname;
 	bool domtu;
 	bool donis;
+	bool donisdom;
 	bool dontp;
 	bool dolastlease;
 	bool doinform;
openSUSE Build Service is sponsored by