normalise patches (context diffs -> unidiffs, and use standard filenames).

no pkg change.
This commit is contained in:
sthen 2013-05-10 09:56:45 +00:00
parent 091f0bba3b
commit e83d9fcc89
34 changed files with 571 additions and 839 deletions

View File

@ -1,108 +1,11 @@
*** README.orig Thu Apr 24 05:38:41 1997
--- README Wed Apr 29 15:32:20 1998
***************
*** 53,58 ****
--- 53,59 ----
BSD/OS 2.0.1; make OSTYPE=bsdos
SunOS 4.1.4; make OSTYPE=sunos4
FreeBSD; make OSTYPE=FreeBSD
+ OpenBSD; make OSTYPE=OpenBSD
<Inquiry>
*** client/README.orig Mon Aug 17 17:31:12 1998
--- client/README Mon Aug 17 17:35:47 1998
***************
*** 45,56 ****
dhcpc 68/udp # dhcp client
The client prints out error messages to syslog with LOG_LOCAL0
! facility. Please add following description to syslog.conf if you
! want. (This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
local0.* /var/log/dhcplog
-
2. How to use the client
--- 45,59 ----
dhcpc 68/udp # dhcp client
The client prints out error messages to syslog with LOG_LOCAL0
! facility (OpenBSD version uses LOG_LOCAL1 to avoid ipmon log conflict).
! Please add following description to syslog.conf if you want.
! (This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
+ OpenBSD:
+ local1.* /var/log/dhcplog
+ other system:
local0.* /var/log/dhcplog
2. How to use the client
*** server/README.orig Tue Oct 17 13:53:39 1995
--- server/README Mon Aug 17 17:48:08 1998
***************
*** 55,66 ****
dhcpc 68/udp # dhcp client
The dhcps prints out error messages to syslog with LOG_LOCAL0
! facility. Please add following description to syslog.conf if you
! want. (This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
local0.* /var/log/dhcplog
-
2. Usage
--- 55,69 ----
dhcpc 68/udp # dhcp client
The dhcps prints out error messages to syslog with LOG_LOCAL0
! facility (OpenBSD version uses LOG_LOCAL1 to avoid ipmon log conflict).
! Please add following description to syslog.conf if you want.
! (This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
+ OpenBSD:
+ local1.* /var/log/dhcplog
+ other system:
local0.* /var/log/dhcplog
2. Usage
*** relay/README.orig Mon Aug 17 17:45:24 1998
--- relay/README Mon Aug 17 17:46:30 1998
***************
*** 43,54 ****
dhcpc 68/udp # dhcp client
The relay agent prints out error messages to syslog with LOG_LOCAL0
! facility. Please add following description to syslog.conf if you
! want. (This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
local0.* /var/log/dhcplog
-
2. Usage
--- 43,57 ----
dhcpc 68/udp # dhcp client
The relay agent prints out error messages to syslog with LOG_LOCAL0
! facility (OpenBSD version uses LOG_LOCAL1 to avoid ipmon log conflict).
! Please add following description to syslog.conf if you want.
! (This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
+ OpenBSD:
+ local1.* /var/log/dhcplog
+ other system:
local0.* /var/log/dhcplog
2. Usage
$OpenBSD: patch-README,v 1.2 2013/05/10 09:56:45 sthen Exp $
--- README.orig Wed Dec 24 09:58:00 1997
+++ README Fri May 10 10:49:49 2013
@@ -52,6 +52,7 @@
BSD/OS 3.1; make OSTYPE=bsdi
SunOS 4.1.4; make OSTYPE=sunos4
FreeBSD; make OSTYPE=FreeBSD
+ OpenBSD; make OSTYPE=OpenBSD
<Inquiry>

View File

@ -1,5 +1,6 @@
--- client/Makefile.OpenBSD.orig Mon Nov 6 22:43:51 2000
+++ client/Makefile.OpenBSD Mon Nov 6 22:45:50 2000
$OpenBSD: patch-client_Makefile_OpenBSD,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- client/Makefile.OpenBSD.orig Fri May 10 10:49:49 2013
+++ client/Makefile.OpenBSD Fri May 10 10:49:49 2013
@@ -0,0 +1,22 @@
+INCLUDE = ../server/dhcp.h dhcpc.h common.h ../server/common_subr.h dhcpc_subr.h
+OBJ = dhcpc_subr.o flushroute.o getmac.o common_subr.o dhcpc.o

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-client_README,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- client/README.orig Tue Oct 17 08:57:02 1995
+++ client/README Fri May 10 10:49:49 2013
@@ -45,12 +45,15 @@ uses default port.
dhcpc 68/udp # dhcp client
The client prints out error messages to syslog with LOG_LOCAL0
-facility. Please add following description to syslog.conf if you
-want. (This is optional configuration and isn't required to operate).
+facility (OpenBSD version uses LOG_LOCAL1 to avoid ipmon log conflict).
+Please add following description to syslog.conf if you want.
+(This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
+OpenBSD:
+ local1.* /var/log/dhcplog
+other system:
local0.* /var/log/dhcplog
-
2. How to use the client

View File

@ -1,36 +0,0 @@
*** client/dhcpc.8.orig Wed Apr 29 15:33:09 1998
--- client/dhcpc.8 Wed Apr 29 15:33:30 1998
***************
*** 26,32 ****
requests server to assign the same address as before.
To get the same address,
.B dhcpc
! creates file named "/etc/dhcp_cache". This file name could be
configured when it is compiled. But it is required that the file must
remains after the host reboot. For example, the /tmp directory is not
appropriate for this purpose.
--- 26,32 ----
requests server to assign the same address as before.
To get the same address,
.B dhcpc
! creates file named "/var/db/dhcp_cache". This file name could be
configured when it is compiled. But it is required that the file must
remains after the host reboot. For example, the /tmp directory is not
appropriate for this purpose.
***************
*** 64,70 ****
.SH FILES
.PD 0
.TP 20
! .B /etc/dhcp_cache
The file to record previously assigned informations
.PD
.SH SEE ALSO
--- 64,70 ----
.SH FILES
.PD 0
.TP 20
! .B /var/db/dhcp_cache
The file to record previously assigned informations
.PD
.SH SEE ALSO

View File

@ -1,19 +0,0 @@
*** client/dhcpc.8.jis.orig Wed Apr 29 15:33:42 1998
--- client/dhcpc.8.jis Wed Apr 29 15:34:01 1998
***************
*** 16,22 ****
ddhhccppcc$B$O(BRFC$B$N5,Dj$K=>$$!"%[%9%H$N(Bshutdown$B$N8e$K:F5/F0$5$l$?>l9g!"(B
$BA02s$HF1$8%"%I%l%9$r3d$jEv$F$F$b$i$&$h$&$K%5!<%P$KMW5a$9$k!#$=(B
! $B$N$?$a$K(B/etc/dhcp_cache$B$H$$$&%U%!%$%k$r:n@.$9$k!#$3$N%U%!%$%k$N(B
$B0LCV$O%3%s%Q%$%k;~$KJQ992DG=$@$,!"(Breboot$B$7$F$b>C5n$5$l$J$$$3$H(B
$B$,MW5a$5$l$k!#(B
--- 16,22 ----
ddhhccppcc$B$O(BRFC$B$N5,Dj$K=>$$!"%[%9%H$N(Bshutdown$B$N8e$K:F5/F0$5$l$?>l9g!"(B
$BA02s$HF1$8%"%I%l%9$r3d$jEv$F$F$b$i$&$h$&$K%5!<%P$KMW5a$9$k!#$=(B
! $B$N$?$a$K(B/var/db/dhcp_cache$B$H$$$&%U%!%$%k$r:n@.$9$k!#$3$N%U%!%$%k$N(B
$B0LCV$O%3%s%Q%$%k;~$KJQ992DG=$@$,!"(Breboot$B$7$F$b>C5n$5$l$J$$$3$H(B
$B$,MW5a$5$l$k!#(B

View File

@ -1,78 +0,0 @@
*** client/dhcpc.c.orig Mon Jul 7 15:08:35 1997
--- client/dhcpc.c Wed Apr 29 15:32:20 1998
***************
*** 990,997 ****
*param_list = tmpparam;
param_list->lease_origin = init_epoch;
param_list->next = NULL;
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 990,997 ----
*param_list = tmpparam;
param_list->lease_origin = init_epoch;
param_list->next = NULL;
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
***************
*** 1240,1247 ****
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 1240,1247 ----
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
***************
*** 1379,1386 ****
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 1379,1386 ----
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
***************
*** 1659,1666 ****
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 1659,1666 ----
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}

View File

@ -1,27 +0,0 @@
*** client/dhcpc.h.orig Thu Nov 13 23:21:26 1997
--- client/dhcpc.h Mon Aug 17 16:54:33 1998
***************
*** 47,57 ****
#endif
#endif /*sony_news*/
! #if defined(__bsdi__) || defined(__FreeBSD__)
#ifndef PATH_CACHE_PREFIX
#define PATH_CACHE_PREFIX "/var/db/dhcpc_cache"
#endif
! #else /* not BSD/OS nor FreeBSD */
#ifndef PATH_CACHE_PREFIX
#define PATH_CACHE_PREFIX "/etc/dhcpc_cache"
#endif
--- 47,57 ----
#endif
#endif /*sony_news*/
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef PATH_CACHE_PREFIX
#define PATH_CACHE_PREFIX "/var/db/dhcpc_cache"
#endif
! #else /* not BSD/OS not FreeBSD nor OpenBSD */
#ifndef PATH_CACHE_PREFIX
#define PATH_CACHE_PREFIX "/etc/dhcpc_cache"
#endif

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-client_dhcpc_8,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- client/dhcpc.8.orig Thu Apr 24 01:08:23 1997
+++ client/dhcpc.8 Fri May 10 10:49:49 2013
@@ -26,7 +26,7 @@ is invoked after rebooting,
requests server to assign the same address as before.
To get the same address,
.B dhcpc
-creates file named "/etc/dhcp_cache". This file name could be
+creates file named "/var/db/dhcp_cache". This file name could be
configured when it is compiled. But it is required that the file must
remains after the host reboot. For example, the /tmp directory is not
appropriate for this purpose.
@@ -64,7 +64,7 @@ or
.SH FILES
.PD 0
.TP 20
-.B /etc/dhcp_cache
+.B /var/db/dhcp_cache
The file to record previously assigned informations
.PD
.SH SEE ALSO

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-client_dhcpc_8_jis,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- client/dhcpc.8.jis.orig Thu Apr 24 01:12:10 1997
+++ client/dhcpc.8.jis Fri May 10 10:49:49 2013
@@ -16,7 +16,7 @@ DHCPC(8) DHCPC(8)
ddhhccppcc$B$O(BRFC$B$N5,Dj$K=>$$!"%[%9%H$N(Bshutdown$B$N8e$K:F5/F0$5$l$?>l9g!"(B
$BA02s$HF1$8%"%I%l%9$r3d$jEv$F$F$b$i$&$h$&$K%5!<%P$KMW5a$9$k!#$=(B
- $B$N$?$a$K(B/etc/dhcp_cache$B$H$$$&%U%!%$%k$r:n@.$9$k!#$3$N%U%!%$%k$N(B
+ $B$N$?$a$K(B/var/db/dhcp_cache$B$H$$$&%U%!%$%k$r:n@.$9$k!#$3$N%U%!%$%k$N(B
$B0LCV$O%3%s%Q%$%k;~$KJQ992DG=$@$,!"(Breboot$B$7$F$b>C5n$5$l$J$$$3$H(B
$B$,MW5a$5$l$k!#(B

View File

@ -0,0 +1,47 @@
$OpenBSD: patch-client_dhcpc_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- client/dhcpc.c.orig Thu Sep 10 00:54:19 1998
+++ client/dhcpc.c Fri May 10 10:49:49 2013
@@ -1015,8 +1015,8 @@ requesting()
*param_list = tmpparam;
param_list->lease_origin = init_epoch;
param_list->next = NULL;
- syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
- inet_ntoa(param_list->yiaddr), param_list->lease_duration);
+ syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
+ inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
@@ -1265,8 +1265,8 @@ renewing()
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
- syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
- inet_ntoa(param_list->yiaddr), param_list->lease_duration);
+ syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
+ inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
@@ -1404,8 +1404,8 @@ rebinding()
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
- syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
- inet_ntoa(param_list->yiaddr), param_list->lease_duration);
+ syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
+ inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
@@ -1684,8 +1684,8 @@ reboot_verify()
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
- syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
- inet_ntoa(param_list->yiaddr), param_list->lease_duration);
+ syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
+ inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-client_dhcpc_h,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- client/dhcpc.h.orig Thu Nov 13 17:21:26 1997
+++ client/dhcpc.h Fri May 10 10:49:49 2013
@@ -47,11 +47,11 @@
#endif
#endif /*sony_news*/
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef PATH_CACHE_PREFIX
#define PATH_CACHE_PREFIX "/var/db/dhcpc_cache"
#endif
-#else /* not BSD/OS nor FreeBSD */
+#else /* not BSD/OS not FreeBSD nor OpenBSD */
#ifndef PATH_CACHE_PREFIX
#define PATH_CACHE_PREFIX "/etc/dhcpc_cache"
#endif

View File

@ -1,203 +0,0 @@
*** client/dhcpc_subr.c.orig Thu Nov 13 21:39:55 1997
--- client/dhcpc_subr.c Mon Aug 17 18:19:06 1998
***************
*** 1110,1116 ****
--- 1110,1121 ----
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
+ #ifndef __OpenBSD__
openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
+ #else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
+ #endif
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
sprintf(cache_filename, "%s.%s", PATH_CACHE_PREFIX, ifp->name);
***************
*** 1314,1320 ****
--- 1319,1331 ----
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
+
+ #ifndef __OpenBSD__
openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
+ #else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
+ #endif
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
sprintf(cache_filename, "%s.%s", PATH_CACHE_PREFIX, ifp->name);
***************
*** 1500,1506 ****
/*
* halt network, and reset the interface
*/
! #if defined(__bsdi__) || defined(__FreeBSD__)
void
reset_if(ifp, updown)
--- 1511,1517 ----
/*
* halt network, and reset the interface
*/
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
void
reset_if(ifp, updown)
***************
*** 1551,1557 ****
#endif
! #if defined(__bsdi__) || defined(__FreeBSD__)
/*
* ifconfig up/down
*/
--- 1562,1568 ----
#endif
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
/*
* ifconfig up/down
*/
***************
*** 1623,1629 ****
* configure network interface
* address, netmask, and broadcast address
*/
! #if defined(__bsdi__) || defined(__FreeBSD__)
int
config_if(ifp, addr, mask, brdcst)
--- 1634,1640 ----
* configure network interface
* address, netmask, and broadcast address
*/
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
int
config_if(ifp, addr, mask, brdcst)
***************
*** 1704,1710 ****
return(0);
}
! #else /* not __bsdi__ nor __FreeBSD__ */
int
config_if(ifp, addr, mask, brdcst)
--- 1715,1721 ----
return(0);
}
! #else /* not __bsdi__ not __FreeBSD__ nor __OpenBSD__ */
int
config_if(ifp, addr, mask, brdcst)
***************
*** 1780,1798 ****
return(0);
}
! #endif /* defined(__bsdi__) || defined(__FreeBSD__) */
/*
* set routing table
*/
! #if !defined(__bsdi__) && !defined(__FreeBSD__)
void
set_route(param)
struct dhcp_param *param;
{
int sockfd = 0;
! #if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__osf__)
#define ortentry rtentry
#endif
struct ortentry rt;
--- 1791,1809 ----
return(0);
}
! #endif /* defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__) */
/*
* set routing table
*/
! #if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
void
set_route(param)
struct dhcp_param *param;
{
int sockfd = 0;
! #if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__osf__)
#define ortentry rtentry
#endif
struct ortentry rt;
***************
*** 1816,1827 ****
bzero(&dst, sizeof(struct sockaddr));
bzero(&gateway, sizeof(struct sockaddr));
rt.rt_flags = RTF_UP | RTF_GATEWAY;
! #if defined(__bsdi__) || defined(__FreeBSD__)
((struct sockaddr_in *) &dst)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &dst)->sin_family = AF_INET;
((struct sockaddr_in *) &dst)->sin_addr.s_addr = INADDR_ANY;
! #if defined(__bsdi__) || defined(__FreeBSD__)
((struct sockaddr_in *) &gateway)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &gateway)->sin_family = AF_INET;
--- 1827,1838 ----
bzero(&dst, sizeof(struct sockaddr));
bzero(&gateway, sizeof(struct sockaddr));
rt.rt_flags = RTF_UP | RTF_GATEWAY;
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
((struct sockaddr_in *) &dst)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &dst)->sin_family = AF_INET;
((struct sockaddr_in *) &dst)->sin_addr.s_addr = INADDR_ANY;
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
((struct sockaddr_in *) &gateway)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &gateway)->sin_family = AF_INET;
***************
*** 2531,2537 ****
struct msghdr msg;
struct iovec bufvec[1];
int bufsize = DFLTDHCPLEN;
! #if defined(__bsdi__) || defined(__FreeBSD__)
int on;
#endif
--- 2542,2548 ----
struct msghdr msg;
struct iovec bufvec[1];
int bufsize = DFLTDHCPLEN;
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
int on;
#endif
***************
*** 3042,3048 ****
}
bcopy(OPTBODY(buf), str, OPTLEN(buf));
! str[OPTLEN(buf)] = '\0';
buf += OPTLEN(buf) + 1;
return(0);
}
--- 3053,3059 ----
}
bcopy(OPTBODY(buf), str, OPTLEN(buf));
! str[(unsigned int)OPTLEN(buf)] = '\0';
buf += OPTLEN(buf) + 1;
return(0);
}

View File

@ -0,0 +1,122 @@
$OpenBSD: patch-client_dhcpc_subr_c,v 1.1 2013/05/10 09:56:45 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
@@ -1110,7 +1110,12 @@ initialize(ifp)
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
+#ifndef __OpenBSD__
openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
+#else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
+#endif
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
sprintf(cache_filename, "%s.%s", PATH_CACHE_PREFIX, ifp->name);
@@ -1314,7 +1319,13 @@ initialize(ifp)
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
+
+#ifndef __OpenBSD__
openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
+#else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
+#endif
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
sprintf(cache_filename, "%s.%s", PATH_CACHE_PREFIX, ifp->name);
@@ -1500,7 +1511,7 @@ initialize(ifp)
/*
* halt network, and reset the interface
*/
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
void
reset_if(ifp, updown)
@@ -1551,7 +1562,7 @@ reset_if(ifp, updown)
#endif
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
/*
* ifconfig up/down
*/
@@ -1623,7 +1634,7 @@ updown_if(ifp, updown)
* configure network interface
* address, netmask, and broadcast address
*/
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
int
config_if(ifp, addr, mask, brdcst)
@@ -1704,7 +1715,7 @@ config_if(ifp, addr, mask, brdcst)
return(0);
}
-#else /* not __bsdi__ nor __FreeBSD__ */
+#else /* not __bsdi__ not __FreeBSD__ nor __OpenBSD__ */
int
config_if(ifp, addr, mask, brdcst)
@@ -1780,19 +1791,19 @@ config_if(ifp, addr, mask, brdcst)
return(0);
}
-#endif /* defined(__bsdi__) || defined(__FreeBSD__) */
+#endif /* defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__) */
/*
* set routing table
*/
-#if !defined(__bsdi__) && !defined(__FreeBSD__)
+#if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
void
set_route(param)
struct dhcp_param *param;
{
int sockfd = 0;
-#if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__osf__)
+#if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__osf__)
#define ortentry rtentry
#endif
struct ortentry rt;
@@ -1816,12 +1827,12 @@ set_route(param)
bzero(&dst, sizeof(struct sockaddr));
bzero(&gateway, sizeof(struct sockaddr));
rt.rt_flags = RTF_UP | RTF_GATEWAY;
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
((struct sockaddr_in *) &dst)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &dst)->sin_family = AF_INET;
((struct sockaddr_in *) &dst)->sin_addr.s_addr = INADDR_ANY;
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
((struct sockaddr_in *) &gateway)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &gateway)->sin_family = AF_INET;
@@ -2531,7 +2542,7 @@ send_unicast(dstip, sdhcp)
struct msghdr msg;
struct iovec bufvec[1];
int bufsize = DFLTDHCPLEN;
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
int on;
#endif
@@ -3077,7 +3088,7 @@ handle_str(buf, param)
}
bcopy(OPTBODY(buf), str, OPTLEN(buf));
- str[OPTLEN(buf)] = '\0';
+ str[(unsigned int)OPTLEN(buf)] = '\0';
buf += OPTLEN(buf) + 1;
return(0);
}

View File

@ -1,113 +0,0 @@
*** client/flushroute.c.orig Tue Apr 14 18:14:33 1998
--- client/flushroute.c Mon Aug 17 18:10:58 1998
***************
*** 34,42 ****
* SUCH DAMAGE.
*/
! #if defined(__bsdi__) || (__FreeBSD__ >= 2)
! /* It's BSD/OS or FreeBSD 2.x */
/*
* Modified by tomy@sfc.wide.ad.jp
--- 34,42 ----
* SUCH DAMAGE.
*/
! #if defined(__bsdi__) || (__FreeBSD__ >= 2) || defined(__OpenBSD__)
! /* It's BSD/OS, FreeBSD 2.x or OpenBSD */
/*
* Modified by tomy@sfc.wide.ad.jp
***************
*** 75,81 ****
* SUCH DAMAGE.
*/
! #ifndef lint
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#endif /* not lint */
--- 75,81 ----
* SUCH DAMAGE.
*/
! #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#endif /* not lint */
***************
*** 240,246 ****
return(0);
}
! #else /* __bsdi__ or FreeBSD 2.x */
#include <stdio.h>
#include <nlist.h>
--- 240,246 ----
return(0);
}
! #else /* __bsdi__, FreeBSD 2.x or OpenBSD */
#include <stdio.h>
#include <nlist.h>
***************
*** 294,314 ****
--- 294,335 ----
nlist("/vmunix", nl);
}
if (nl[N_RTHOST].n_value == 0) {
+ #ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR, "\"rthost\", symbol not in namelist");
+ #else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR, "\"rthost\", symbol not in namelist");
+ #endif
exit(1);
}
if (nl[N_RTNET].n_value == 0) {
+ #ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR, "\"rtnet\", symbol not in namelist");
+ #else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR, "\"rtnet\", symbol not in namelist");
+ #endif
exit(1);
}
if (nl[N_RTHASHSIZE].n_value == 0) {
+ #ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR,
"\"rthashsize\", symbol not in namelist");
+ #else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR,
+ "\"rthashsize\", symbol not in namelist");
+ #endif
exit(1);
}
kmem = open("/dev/kmem", 0);
if (kmem < 0) {
+ #ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR, "/dev/kmem: %m");
+ #else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR, "/dev/kmem: %m");
+ #endif
exit(1);
}
lseek(kmem, nl[N_RTHASHSIZE].n_value, 0);
***************
*** 345,348 ****
return(0);
}
! #endif /* __bsdi__ or FreeBSD 2.x */
--- 366,369 ----
return(0);
}
! #endif /* __bsdi__, FreeBSD 2.x or OpenBSD */

View File

@ -0,0 +1,82 @@
$OpenBSD: patch-client_flushroute_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- client/flushroute.c.orig Tue Apr 14 12:14:33 1998
+++ client/flushroute.c Fri May 10 10:49:49 2013
@@ -34,9 +34,9 @@
* SUCH DAMAGE.
*/
-#if defined(__bsdi__) || (__FreeBSD__ >= 2)
+#if defined(__bsdi__) || (__FreeBSD__ >= 2) || defined(__OpenBSD__)
-/* It's BSD/OS or FreeBSD 2.x */
+/* It's BSD/OS, FreeBSD 2.x or OpenBSD */
/*
* Modified by tomy@sfc.wide.ad.jp
@@ -75,7 +75,7 @@
* SUCH DAMAGE.
*/
-#ifndef lint
+#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#endif /* not lint */
@@ -240,7 +240,7 @@ flushroutes(ifname)
return(0);
}
-#else /* __bsdi__ or FreeBSD 2.x */
+#else /* __bsdi__, FreeBSD 2.x or OpenBSD */
#include <stdio.h>
#include <nlist.h>
@@ -294,21 +294,42 @@ flushroutes(dummy)
nlist("/vmunix", nl);
}
if (nl[N_RTHOST].n_value == 0) {
+#ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR, "\"rthost\", symbol not in namelist");
+#else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR, "\"rthost\", symbol not in namelist");
+#endif
exit(1);
}
if (nl[N_RTNET].n_value == 0) {
+#ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR, "\"rtnet\", symbol not in namelist");
+#else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR, "\"rtnet\", symbol not in namelist");
+#endif
exit(1);
}
if (nl[N_RTHASHSIZE].n_value == 0) {
+#ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR,
"\"rthashsize\", symbol not in namelist");
+#else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR,
+ "\"rthashsize\", symbol not in namelist");
+#endif
exit(1);
}
kmem = open("/dev/kmem", 0);
if (kmem < 0) {
+#ifndef __OpenBSD__
syslog(LOG_LOCAL0|LOG_ERR, "/dev/kmem: %m");
+#else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ syslog(LOG_LOCAL1|LOG_ERR, "/dev/kmem: %m");
+#endif
exit(1);
}
lseek(kmem, nl[N_RTHASHSIZE].n_value, 0);
@@ -345,4 +366,4 @@ again:
return(0);
}
-#endif /* __bsdi__ or FreeBSD 2.x */
+#endif /* __bsdi__, FreeBSD 2.x or OpenBSD */

View File

@ -1,5 +1,6 @@
--- relay/Makefile.OpenBSD.orig Mon Nov 6 22:43:51 2000
+++ relay/Makefile.OpenBSD Mon Nov 6 22:50:10 2000
$OpenBSD: patch-relay_Makefile_OpenBSD,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- relay/Makefile.OpenBSD.orig Fri May 10 10:49:49 2013
+++ relay/Makefile.OpenBSD Fri May 10 10:49:49 2013
@@ -0,0 +1,23 @@
+OBJ = relay.o getmac.o common_subr.o interface.o
+LDFLAGS = -lkvm

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-relay_README,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- relay/README.orig Tue Oct 17 09:01:48 1995
+++ relay/README Fri May 10 10:49:49 2013
@@ -43,12 +43,15 @@ agent works correctly whether or not you will do so.
dhcpc 68/udp # dhcp client
The relay agent prints out error messages to syslog with LOG_LOCAL0
-facility. Please add following description to syslog.conf if you
-want. (This is optional configuration and isn't required to operate).
+facility (OpenBSD version uses LOG_LOCAL1 to avoid ipmon log conflict).
+Please add following description to syslog.conf if you want.
+(This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
+OpenBSD:
+ local1.* /var/log/dhcplog
+other system:
local0.* /var/log/dhcplog
-
2. Usage

View File

@ -1,34 +0,0 @@
*** relay/relay.c.orig Mon Jul 7 15:10:02 1997
--- relay/relay.c Mon Aug 17 18:32:42 1998
***************
*** 117,123 ****
static void forwarding();
int open_if();
! void
main(argc, argv)
int argc;
char **argv;
--- 117,123 ----
static void forwarding();
int open_if();
! int
main(argc, argv)
int argc;
char **argv;
***************
*** 179,185 ****
--- 179,190 ----
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
+ #ifndef __OpenBSD__
openlog("relay", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
+ #else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ openlog("relay", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
+ #endif
if (debug == 0) become_daemon();
if (if_list == NULL) usage();

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-relay_relay_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- relay/relay.c.orig Mon Jul 7 09:10:02 1997
+++ relay/relay.c Fri May 10 10:49:50 2013
@@ -117,7 +117,7 @@ static void relay_tocli();
static void forwarding();
int open_if();
-void
+int
main(argc, argv)
int argc;
char **argv;
@@ -179,7 +179,12 @@ main(argc, argv)
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
+#ifndef __OpenBSD__
openlog("relay", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
+#else
+ /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+ openlog("relay", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
+#endif
if (debug == 0) become_daemon();
if (if_list == NULL) usage();

View File

@ -1,5 +1,6 @@
--- server/Makefile.OpenBSD.orig Mon Nov 6 22:43:51 2000
+++ server/Makefile.OpenBSD Mon Nov 6 22:49:48 2000
$OpenBSD: patch-server_Makefile_OpenBSD,v 1.1 2013/05/10 09:56:45 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 @@
+OBJ = dhcps.o database.o hash.o getmac.o common_subr.o \
+ interface.o delarp.o

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-server_README,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- server/README.orig Tue Oct 17 08:53:39 1995
+++ server/README Fri May 10 10:49:49 2013
@@ -55,12 +55,15 @@ works correctly whether or not you will do so.
dhcpc 68/udp # dhcp client
The dhcps prints out error messages to syslog with LOG_LOCAL0
-facility. Please add following description to syslog.conf if you
-want. (This is optional configuration and isn't required to operate).
+facility (OpenBSD version uses LOG_LOCAL1 to avoid ipmon log conflict).
+Please add following description to syslog.conf if you want.
+(This is optional configuration and isn't required to operate).
Actual description for each OS may have subtle differences.
+OpenBSD:
+ local1.* /var/log/dhcplog
+other system:
local0.* /var/log/dhcplog
-
2. Usage

View File

@ -1,9 +0,0 @@
*** server/common.h.orig Mon Aug 17 18:13:35 1998
--- server/common.h Mon Aug 17 18:14:02 1998
***************
*** 339,341 ****
--- 339,342 ----
char *haddrtos();
char *cidtos();
char *_ctime();
+ char *chaddrtos();

View File

@ -0,0 +1,8 @@
$OpenBSD: patch-server_common_h,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- server/common.h.orig Fri Jan 30 08:48:43 1998
+++ server/common.h Fri May 10 10:49:50 2013
@@ -339,3 +339,4 @@ void restart();
char *haddrtos();
char *cidtos();
char *_ctime();
+char *chaddrtos();

View File

@ -1,5 +1,6 @@
--- server/database.c.orig Fri Feb 20 20:48:53 1998
+++ server/database.c Tue Dec 22 09:16:55 1998
$OpenBSD: patch-server_database_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- server/database.c.orig Fri Feb 20 14:48:53 1998
+++ server/database.c Fri May 10 10:49:50 2013
@@ -55,7 +55,6 @@
#include "hash.h"
#include "database.h"
@ -8,7 +9,7 @@
void
dump_bind_db()
{
@@ -122,8 +121,27 @@
@@ -122,8 +121,27 @@ dump_bind_entry(bp)
void
dump_addrpool_db()
{
@ -36,7 +37,7 @@
if ((dump_fp = freopen(ADDRPOOL_DUMP, "w+", dump_fp)) == NULL) {
syslog(LOG_WARNING,
"Cannot reopen the address pool dump file \"%s\"", ADDRPOOL_DUMP);
@@ -250,7 +268,7 @@
@@ -250,7 +268,7 @@ dump_addrpool_entry(rp)
if (isset(rp->valid, S_SUBNET_MASK)) print_ip("snmk", rp->subnet_mask);
if (isset(rp->active, S_TIME_OFFSET)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_TIME_OFFSET))
@ -45,7 +46,7 @@
if (isset(rp->active, S_ROUTER)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ROUTER)) print_ips("rout", rp->router);
if (isset(rp->active, S_TIME_SERVER)) fprintf(dump_fp, "!");
@@ -299,7 +317,7 @@
@@ -299,7 +317,7 @@ dump_addrpool_entry(rp)
fprintf(dump_fp, "ditl=%u:", rp->default_ip_ttl);
if (isset(rp->active, S_MTU_AGING_TIMEOUT)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_MTU_AGING_TIMEOUT))
@ -54,7 +55,7 @@
if (isset(rp->active, S_MTU_PLATEAU_TABLE)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_MTU_PLATEAU_TABLE)) {
fprintf(dump_fp, "mtpt=");
@@ -329,7 +347,7 @@
@@ -329,7 +347,7 @@ dump_addrpool_entry(rp)
if (isset(rp->valid, S_TRAILER)) print_bool("tril", rp->trailer);
if (isset(rp->active, S_ARP_CACHE_TIMEOUT)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ARP_CACHE_TIMEOUT))
@ -63,7 +64,7 @@
if (isset(rp->active, S_ETHER_ENCAP)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ETHER_ENCAP)) print_bool("encp", rp->ether_encap);
if (isset(rp->active, S_DEFAULT_TCP_TTL)) fprintf(dump_fp, "!");
@@ -337,7 +355,7 @@
@@ -337,7 +355,7 @@ dump_addrpool_entry(rp)
fprintf(dump_fp, "dttl=%u:", rp->default_tcp_ttl);
if (isset(rp->active, S_KEEPALIVE_INTER)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_KEEPALIVE_INTER))

View File

@ -1,53 +0,0 @@
*** server/delarp.c.orig Thu Sep 11 08:28:58 1997
--- server/delarp.c Mon Aug 17 17:16:09 1998
***************
*** 37,43 ****
* SUCH DAMAGE.
*/
! #ifndef lint
static char sccsid[] = "@(#)arp.c 8.2 (Berkeley) 1/2/94";
#endif /* not lint */
--- 37,43 ----
* SUCH DAMAGE.
*/
! #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)arp.c 8.2 (Berkeley) 1/2/94";
#endif /* not lint */
***************
*** 60,66 ****
#include <syslog.h>
! #if defined(__bsdi__) || (__FreeBSD__ >= 2)
/*
* delarp for BSD/OS 2.*
*/
--- 60,66 ----
#include <syslog.h>
! #if defined(__bsdi__) || (__FreeBSD__ >= 2) || defined(__OpenBSD__)
/*
* delarp for BSD/OS 2.*
*/
***************
*** 184,190 ****
#else
/*
! * it is not BSD/OS 2.* nor FreeBSD
*/
#include <sys/ioctl.h>
--- 184,190 ----
#else
/*
! * it is not BSD/OS 2.* not FreeBSD nor OpenBSD
*/
#include <sys/ioctl.h>

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-server_delarp_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- server/delarp.c.orig Thu Sep 11 02:28:58 1997
+++ server/delarp.c Fri May 10 10:49:50 2013
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*/
-#ifndef lint
+#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)arp.c 8.2 (Berkeley) 1/2/94";
#endif /* not lint */
@@ -60,7 +60,7 @@ static char sccsid[] = "@(#)arp.c 8.2 (Berkeley)
#include <syslog.h>
-#if defined(__bsdi__) || (__FreeBSD__ >= 2)
+#if defined(__bsdi__) || (__FreeBSD__ >= 2) || defined(__OpenBSD__)
/*
* delarp for BSD/OS 2.*
*/
@@ -184,7 +184,7 @@ tryagain:
#else
/*
- * it is not BSD/OS 2.* nor FreeBSD
+ * it is not BSD/OS 2.* not FreeBSD nor OpenBSD
*/
#include <sys/ioctl.h>

View File

@ -1,35 +0,0 @@
*** server/dhcps.h.orig Sat Feb 21 11:41:56 1998
--- server/dhcps.h Mon Aug 17 18:08:34 1998
***************
*** 37,51 ****
* WIDE project has the rights to redistribute these changes.
*/
! #if defined(__bsdi__) || defined(__FreeBSD__)
#ifndef BINDING_DB
#define BINDING_DB "/var/db/dhcpdb.bind"
#endif
! #else /* not BSD/OS nor FreeBSD */
#ifndef BINDING_DB
#define BINDING_DB "/etc/dhcpdb.bind"
#endif
! #endif /* __bsdi__ || __FreeBSD__ */
#ifdef sony_news
#ifndef PATH_PID
--- 37,51 ----
* WIDE project has the rights to redistribute these changes.
*/
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef BINDING_DB
#define BINDING_DB "/var/db/dhcpdb.bind"
#endif
! #else /* not BSD/OS not FreeBSD nor OpenBSD */
#ifndef BINDING_DB
#define BINDING_DB "/etc/dhcpdb.bind"
#endif
! #endif /* __bsdi__ || __FreeBSD__ || __OpenBSD__ */
#ifdef sony_news
#ifndef PATH_PID

View File

@ -1,6 +1,7 @@
--- server/dhcps.c.orig Sun Jul 19 09:16:53 1998
+++ server/dhcps.c Tue Dec 22 09:19:18 1998
@@ -136,7 +136,7 @@
$OpenBSD: patch-server_dhcps_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- server/dhcps.c.orig Sun Jul 19 03:16:53 1998
+++ server/dhcps.c Fri May 10 10:49:50 2013
@@ -136,7 +136,7 @@ char allowed_haddr[MAX_CLIENTS][6];
int nmacaddr;
#endif
@ -9,7 +10,7 @@
main(argc, argv)
int argc;
char **argv;
@@ -146,7 +146,7 @@
@@ -146,7 +146,7 @@ main(argc, argv)
struct if_info *ifp = NULL; /* pointer to interface */
char *option = NULL; /* command line option */
char msgtype; /* DHCP message type */
@ -18,7 +19,7 @@
struct ifreq ifreq;
bzero(&ifreq, sizeof(ifreq));
@@ -228,9 +228,19 @@
@@ -228,9 +228,19 @@ main(argc, argv)
#define LOG_PERROR 0 /* Don't bother if not defined... */
#endif
if (debug == 1) {
@ -38,7 +39,7 @@
}
init_db(); /* initialize databases */
@@ -540,6 +550,11 @@
@@ -540,6 +550,11 @@ check_pkt1(ifp)
static void
init_db()
{
@ -50,7 +51,7 @@
if (addrpool_db[0] == '\0') strcpy(addrpool_db, ADDRPOOL_DB);
if ((addrpool_dbfp = fopen(addrpool_db, "r")) == NULL) {
syslog(LOG_ERR, "Cannot open the resource database \"%s\"", addrpool_db);
@@ -563,7 +578,23 @@
@@ -563,7 +578,23 @@ init_db()
syslog(LOG_ERR, "Cannot open the binding database \"%s\"", binding_db);
exit(1);
}
@ -74,7 +75,7 @@
if ((dump_fp = fopen(ADDRPOOL_DUMP, "w+")) == NULL) {
syslog(LOG_ERR, "Cannot open the resource dump file \"%s\"",ADDRPOOL_DUMP);
exit(1);
@@ -1921,7 +1952,11 @@
@@ -1921,7 +1952,11 @@ send_dhcp(ifp, msgtype)
snd.dhcp->options[off_options] = END;
} else if (off_extopt > 0 && off_extopt < maxoptlen - DFLTOPTLEN &&
sbufvec[1].iov_base != NULL) {
@ -86,7 +87,7 @@
}
if (off_extopt < sbufvec[1].iov_len) {
@@ -2378,7 +2413,11 @@
@@ -2378,7 +2413,11 @@ ins_ip(res, lease, tagnum, inserted, flag)
char *inserted;
char flag;
{
@ -98,7 +99,7 @@
char option[6];
int symbol = 0;
int retval = 0;
@@ -2939,7 +2978,11 @@
@@ -2939,7 +2978,11 @@ insert_it(opt)
len -= done;
off_options += done; /* invalid offset, So, to access
here will cause fatal error */
@ -110,7 +111,7 @@
off_extopt += len;
return(0);
}
@@ -3016,7 +3059,7 @@
@@ -3016,7 +3059,7 @@ icmp_check(msgtype, ip)
return(GOOD);
}

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-server_dhcps_h,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- server/dhcps.h.orig Sat Feb 21 05:41:56 1998
+++ server/dhcps.h Fri May 10 10:49:50 2013
@@ -37,15 +37,15 @@
* WIDE project has the rights to redistribute these changes.
*/
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef BINDING_DB
#define BINDING_DB "/var/db/dhcpdb.bind"
#endif
-#else /* not BSD/OS nor FreeBSD */
+#else /* not BSD/OS not FreeBSD nor OpenBSD */
#ifndef BINDING_DB
#define BINDING_DB "/etc/dhcpdb.bind"
#endif
-#endif /* __bsdi__ || __FreeBSD__ */
+#endif /* __bsdi__ || __FreeBSD__ || __OpenBSD__ */
#ifdef sony_news
#ifndef PATH_PID

View File

@ -1,79 +0,0 @@
*** server/getmac.c.orig Tue Jun 4 10:27:49 1996
--- server/getmac.c Wed Apr 29 15:32:21 1998
***************
*** 79,92 ****
--- 79,98 ----
struct in_ifaddr in;
} ifaddr;
u_long addr = 0;
+ #if defined(__OpenBSD__)
+ #else
char name[16];
char fullname[16];
+ #endif
static kvm_t *kd = NULL;
bzero(&arpcom, sizeof(arpcom));
bzero(&ifaddr, sizeof(ifaddr));
+ #if defined(__OpenBSD__)
+ #else
bzero(name, sizeof(name));
bzero(fullname, sizeof(fullname));
+ #endif
/* Open kernel memory for reading */
kd = kvm_open(0, 0, 0, O_RDONLY, "kvm_open");
***************
*** 104,110 ****
ac = &arpcom;
ifp = &arpcom.ac_if;
! #if defined(__bsdi__) || defined(__FreeBSD__)
ep = arpcom.ac_enaddr;
#else
ep = arpcom.ac_enaddr.ether_addr_octet;
--- 110,116 ----
ac = &arpcom;
ifp = &arpcom.ac_if;
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
ep = arpcom.ac_enaddr;
#else
ep = arpcom.ac_enaddr.ether_addr_octet;
***************
*** 118,124 ****
--- 124,134 ----
kvm_close(kd);
return(-1);
}
+ #if defined(__OpenBSD__)
+ for ( ; addr; addr = (u_long)ifp->if_list.tqe_next) {
+ #else
for ( ; addr; addr = (u_long)ifp->if_next) {
+ #endif
if (kvm_read(kd, addr, (char *)ac, sizeof(*ac)) != sizeof(*ac)) {
syslog(LOG_ERR, "kvm_read() error in getmac(): %m");
kvm_close(kd);
***************
*** 129,134 ****
--- 139,148 ----
continue;
/* Only look at the specified interface */
+ #if defined(__OpenBSD__)
+ if (strcmp(ifp->if_xname, ifname) != 0)
+ continue;
+ #else
if (kvm_read(kd, (u_long)ifp->if_name, (char *)name, sizeof(name)) !=
sizeof(name)) {
syslog(LOG_ERR, "kvm_read() error in getmac(): %m");
***************
*** 139,144 ****
--- 153,159 ----
sprintf(fullname, "%s%d", name, ifp->if_unit);
if (strcmp(fullname, ifname) != 0)
continue;
+ #endif
kvm_close(kd);
bcopy(ep, result, 6);

View File

@ -0,0 +1,64 @@
$OpenBSD: patch-server_getmac_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- server/getmac.c.orig Thu Sep 11 02:27:06 1997
+++ server/getmac.c Fri May 10 10:49:50 2013
@@ -85,14 +85,20 @@ getmac(ifname, result)
struct in_ifaddr in;
} ifaddr;
u_long addr = 0;
+#if defined(__OpenBSD__)
+#else
char name[16];
char fullname[16];
+#endif
static kvm_t *kd = NULL;
bzero(&arpcom, sizeof(arpcom));
bzero(&ifaddr, sizeof(ifaddr));
+#if defined(__OpenBSD__)
+#else
bzero(name, sizeof(name));
bzero(fullname, sizeof(fullname));
+#endif
/* Open kernel memory for reading */
kd = kvm_open(0, 0, 0, O_RDONLY, "kvm_open");
@@ -110,7 +116,7 @@ getmac(ifname, result)
ac = &arpcom;
ifp = &arpcom.ac_if;
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
ep = arpcom.ac_enaddr;
#else
ep = arpcom.ac_enaddr.ether_addr_octet;
@@ -124,7 +130,11 @@ getmac(ifname, result)
kvm_close(kd);
return(-1);
}
+#if defined(__OpenBSD__)
+ for ( ; addr; addr = (u_long)ifp->if_list.tqe_next) {
+#else
for ( ; addr; addr = (u_long)ifp->if_next) {
+#endif
if (kvm_read(kd, addr, (char *)ac, sizeof(*ac)) != sizeof(*ac)) {
syslog(LOG_ERR, "kvm_read() error in getmac(): %m");
kvm_close(kd);
@@ -135,6 +145,10 @@ getmac(ifname, result)
continue;
/* Only look at the specified interface */
+#if defined(__OpenBSD__)
+ if (strcmp(ifp->if_xname, ifname) != 0)
+ continue;
+#else
if (kvm_read(kd, (u_long)ifp->if_name, (char *)name, sizeof(name)) !=
sizeof(name)) {
syslog(LOG_ERR, "kvm_read() error in getmac(): %m");
@@ -145,6 +159,7 @@ getmac(ifname, result)
sprintf(fullname, "%s%d", name, ifp->if_unit);
if (strcmp(fullname, ifname) != 0)
continue;
+#endif
kvm_close(kd);
bcopy(ep, result, 6);

View File

@ -1,5 +1,6 @@
--- tools/Makefile.OpenBSD.orig Mon Nov 6 22:43:51 2000
+++ tools/Makefile.OpenBSD Mon Nov 6 22:48:39 2000
$OpenBSD: patch-tools_Makefile_OpenBSD,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- tools/Makefile.OpenBSD.orig Fri May 10 10:49:50 2013
+++ tools/Makefile.OpenBSD Fri May 10 10:49:50 2013
@@ -0,0 +1,9 @@
+dhcpm: dhcpm.c ../server/dhcp.h
+ $(CC) $(CFLAGS) dhcpm.c -o dhcpm

View File

@ -1,19 +0,0 @@
*** tools/dhcpm.c.orig Mon Jul 7 15:07:06 1997
--- tools/dhcpm.c Wed Apr 29 15:32:21 1998
***************
*** 427,433 ****
((option = pickup_opt(rdhcp, DHCPLEN(rudp), DHCP_T2)) != NULL) ?
GETHL(OPTBODY(option)) : 0);
printf("\top: %d, xid: %lx, secs: %d, BRDCST flag: %d\n", rdhcp->op,
! ntohl(rdhcp->xid), ntohs(rdhcp->secs), ISBRDCST(rdhcp->flags) ? 1:0);
printf("\tciaddr: %s, ", inet_ntoa(rdhcp->ciaddr));
printf("yiaddr: %s, ", inet_ntoa(rdhcp->yiaddr));
printf("siaddr: %s, ", inet_ntoa(rdhcp->siaddr));
--- 427,433 ----
((option = pickup_opt(rdhcp, DHCPLEN(rudp), DHCP_T2)) != NULL) ?
GETHL(OPTBODY(option)) : 0);
printf("\top: %d, xid: %lx, secs: %d, BRDCST flag: %d\n", rdhcp->op,
! (unsigned long)ntohl(rdhcp->xid), ntohs(rdhcp->secs), ISBRDCST(rdhcp->flags) ? 1:0);
printf("\tciaddr: %s, ", inet_ntoa(rdhcp->ciaddr));
printf("yiaddr: %s, ", inet_ntoa(rdhcp->yiaddr));
printf("siaddr: %s, ", inet_ntoa(rdhcp->siaddr));

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-tools_dhcpm_c,v 1.1 2013/05/10 09:56:45 sthen Exp $
--- tools/dhcpm.c.orig Tue Sep 8 12:54:04 1998
+++ tools/dhcpm.c Fri May 10 10:49:50 2013
@@ -427,7 +427,7 @@ main(argc, argv)
((option = pickup_opt(rdhcp, DHCPLEN(rudp), DHCP_T2)) != NULL) ?
GETHL(OPTBODY(option)) : 0);
printf("\top: %d, xid: %lx, secs: %d, BRDCST flag: %d\n", rdhcp->op,
- ntohl(rdhcp->xid), ntohs(rdhcp->secs), ISBRDCST(rdhcp->flags) ? 1:0);
+ (unsigned long)ntohl(rdhcp->xid), ntohs(rdhcp->secs), ISBRDCST(rdhcp->flags) ? 1:0);
printf("\tciaddr: %s, ", inet_ntoa(rdhcp->ciaddr));
printf("yiaddr: %s, ", inet_ntoa(rdhcp->yiaddr));
printf("siaddr: %s, ", inet_ntoa(rdhcp->siaddr));