Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Mar 2007 23:51:20 +0000
From:      "Bruce M. Simpson" <bms@FreeBSD.org>
To:        Scott Ullrich <sullrich@gmail.com>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, Joerg.Pulz@frm2.tum.de
Subject:   Re: Compiling ISC DHCP Server on current - ascii2addr() errors
Message-ID:  <45EDFE78.4080702@FreeBSD.org>
In-Reply-To: <d5992baf0703051421x2112cc8bl43786c0460ca9599@mail.gmail.com>
References:  <d5992baf0703051421x2112cc8bl43786c0460ca9599@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060602060206020005070506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Scott Ullrich wrote:
>
>
> Recently this function was renamed/moved(?) by bms.
Terminated with extreme prejudice.
We reached consensus on this over a year ago, just no one actually made 
it happen til now.
>
> Is there a solution or workaround to get DHCP compiling again?
Try this. addr2ascii() is only special and magic if used for AF_LINK. 
inet_pton() is fine for this job.

This patch should be good for all branches and should probably go upstream.

Regards,
BMS

--------------060602060206020005070506
Content-Type: text/x-patch;
 name="dhcp.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="dhcp.patch"

--- dhcpd.c.orig	Tue Mar  6 23:45:25 2007
+++ dhcpd.c	Tue Mar  6 23:46:28 2007
@@ -379,7 +379,7 @@
 			set_jail = argv [i];
 			if (++i == argc)
 				usage ();
-			if (ascii2addr (AF_INET, argv[i], &jail_ip_address) < 0)
+			if (inet_pton (AF_INET, argv[i], &jail_ip_address) < 0)
 				log_fatal ("invalid ip address: %s", argv[i]);
 			jail_ip_address = ntohl (jail_ip_address);
 			no_dhcpd_jail = 1;
@@ -478,7 +478,7 @@
 	if (!no_dhcpd_jail && (s = getenv ("DHCPD_JAIL_HOSTNAME")) &&
 	    (s2 = getenv ("DHCPD_JAIL_IPADDRESS"))) {
 		set_jail = s;
-		if (ascii2addr (AF_INET, s2, &jail_ip_address) < 0)
+		if (inet_pton (AF_INET, s2, &jail_ip_address) < 0)
 			log_fatal ("invalid ip address: %s", s2);
 		jail_ip_address = ntohl (jail_ip_address);
 	}

--------------060602060206020005070506--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45EDFE78.4080702>