- swap order of ioctls so SIOCSIFADDR comes before SIOCSIFNETMASK

- remove unneeded MESSAGE
- don't use tbl to format manpages, it's no longer needed
- mark as NOT_FOR_ARCHS=${LP64_ARCHS}, it's broken there
(uses wrong MAC address)
This commit is contained in:
sthen 2013-05-10 10:45:46 +00:00
parent 08ec122a4b
commit a7a0b0fa7f
4 changed files with 36 additions and 17 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.25 2013/05/10 10:26:42 sthen Exp $
# $OpenBSD: Makefile,v 1.26 2013/05/10 10:45:46 sthen Exp $
COMMENT= client and servers for the WIDE DHCP protocol
NOT_FOR_ARCHS= ${LP64_ARCHS}
DISTNAME= dhcp-1.4.0p3
PKGNAME= wide-dhcp-1.4.0.3
REVISION= 3
REVISION= 4
CATEGORIES= net
MASTER_SITES= ftp://sh.wide.ad.jp/WIDE/free-ware/dhcp/

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-client_dhcpc_subr_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
$OpenBSD: patch-client_dhcpc_subr_c,v 1.2 2013/05/10 10:45:46 sthen Exp $
--- client/dhcpc_subr.c.orig Thu Sep 10 01:06:39 1998
+++ client/dhcpc_subr.c Fri May 10 10:49:49 2013
+++ client/dhcpc_subr.c Fri May 10 11:27:24 2013
@@ -1110,7 +1110,12 @@ initialize(ifp)
#ifndef LOG_PERROR
#define LOG_PERROR 0
@ -64,6 +64,35 @@ $OpenBSD: patch-client_dhcpc_subr_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
int
config_if(ifp, addr, mask, brdcst)
@@ -1745,22 +1756,22 @@ config_if(ifp, addr, mask, brdcst)
}
flushroutes(ifp->name);
- if (mask != NULL) {
+ if (addr != NULL) {
bzero(&ifr, sizeof(struct ifreq));
strcpy(ifr.ifr_name, ifp->name);
((struct sockaddr_in *) &ifr.ifr_addr)->sin_family = AF_INET;
- ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = mask->s_addr;
- if (ioctl(sockfd, SIOCSIFNETMASK, &ifr) < 0) {
+ ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = addr->s_addr;
+ if (ioctl(sockfd, SIOCSIFADDR, &ifr) < 0) {
close(sockfd);
return(-1);
}
}
- if (addr != NULL) {
+ if (mask != NULL) {
bzero(&ifr, sizeof(struct ifreq));
strcpy(ifr.ifr_name, ifp->name);
((struct sockaddr_in *) &ifr.ifr_addr)->sin_family = AF_INET;
- ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = addr->s_addr;
- if (ioctl(sockfd, SIOCSIFADDR, &ifr) < 0) {
+ ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = mask->s_addr;
+ if (ioctl(sockfd, SIOCSIFNETMASK, &ifr) < 0) {
close(sockfd);
return(-1);
}
@@ -1780,19 +1791,19 @@ config_if(ifp, addr, mask, brdcst)
return(0);
}

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-server_Makefile_OpenBSD,v 1.1 2013/05/10 09:56:45 sthen Exp $
$OpenBSD: patch-server_Makefile_OpenBSD,v 1.2 2013/05/10 10:45:46 sthen Exp $
--- server/Makefile.OpenBSD.orig Fri May 10 10:49:50 2013
+++ server/Makefile.OpenBSD Fri May 10 10:49:50 2013
@@ -0,0 +1,23 @@
@ -11,7 +11,7 @@ $OpenBSD: patch-server_Makefile_OpenBSD,v 1.1 2013/05/10 09:56:45 sthen Exp $
+
+install: dhcps
+ ${INSTALL} -m 755 -s dhcps ${SBIN}/dhcps
+ tbl dhcpdb.pool.5 >${MAN}/man5/dhcpdb.pool.5
+ cp dhcpdb.pool.5 ${MAN}/man5/dhcpdb.pool.5
+ cp dhcpdb.relay.5 ${MAN}/man5/dhcpdb.relay.5
+ cp dhcps.8 ${MAN}/man8/dhcps.8
+

View File

@ -1,11 +0,0 @@
You may need to add these entries to your /etc/services file
to register the dhcp services:
dhcps 67/udp # dhcp server
dhcpc 68/udp # dhcp client
Also, ensure that BPF support is compiled into the kernel.
Examples and documentation are in:
${PREFIX}/share/doc/wide-dhcp , and
${PREFIX}/share/examples/wide-dhcp