git: cfb9be506285 - main - bootp: remove the USE_BFUNCS knob

Kyle Evans kevans at FreeBSD.org
Fri Oct 1 04:47:16 UTC 2021


The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=cfb9be506285cd65120f9686d532130a3757ce56

commit cfb9be506285cd65120f9686d532130a3757ce56
Author:     Kyle Evans <kevans at FreeBSD.org>
AuthorDate: 2021-09-30 03:01:34 +0000
Commit:     Kyle Evans <kevans at FreeBSD.org>
CommitDate: 2021-10-01 04:47:06 +0000

    bootp: remove the USE_BFUNCS knob
    
    We'd likely be better served by converting these to the equivalent mem*
    calls, but just kill the knob for now. The b* macros being defined get
    in the way of _FORTIFY_SOURCE.
    
    Reviewed by:    imp, markj
    Differential Revision:  https://reviews.freebsd.org/D32235
---
 libexec/bootpd/bootpd.c                    | 8 --------
 libexec/bootpd/bootpgw/bootpgw.c           | 8 --------
 libexec/bootpd/dovend.c                    | 9 ---------
 libexec/bootpd/dumptab.c                   | 9 +--------
 libexec/bootpd/hash.c                      | 9 +--------
 libexec/bootpd/hwaddr.c                    | 8 --------
 libexec/bootpd/lookup.c                    | 7 +------
 libexec/bootpd/readfile.c                  | 8 --------
 libexec/bootpd/tools/bootpef/bootpef.c     | 8 --------
 libexec/bootpd/tools/bootptest/bootptest.h | 8 --------
 10 files changed, 3 insertions(+), 79 deletions(-)

diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c
index 86e4f56ab61a..42f1cd8c5912 100644
--- a/libexec/bootpd/bootpd.c
+++ b/libexec/bootpd/bootpd.c
@@ -73,14 +73,6 @@ __FBSDID("$FreeBSD$");
 # include <fcntl.h>		/* for O_RDONLY, etc */
 #endif
 
-#ifndef	USE_BFUNCS
-# include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-# define bcopy(a,b,c)    memcpy(b,a,c)
-# define bzero(p,l)      memset(p,0,l)
-# define bcmp(a,b,c)     memcmp(a,b,c)
-#endif
-
 #include "bootp.h"
 #include "hash.h"
 #include "hwaddr.h"
diff --git a/libexec/bootpd/bootpgw/bootpgw.c b/libexec/bootpd/bootpgw/bootpgw.c
index 2e2df9e71a2a..3c128c03a9a6 100644
--- a/libexec/bootpd/bootpgw/bootpgw.c
+++ b/libexec/bootpd/bootpgw/bootpgw.c
@@ -66,14 +66,6 @@ __FBSDID("$FreeBSD$");
 # include <fcntl.h>		/* for O_RDONLY, etc */
 #endif
 
-#ifndef	USE_BFUNCS
-# include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-# define bcopy(a,b,c)    memcpy(b,a,c)
-# define bzero(p,l)      memset(p,0,l)
-# define bcmp(a,b,c)     memcmp(a,b,c)
-#endif
-
 #include "bootp.h"
 #include "getif.h"
 #include "hwaddr.h"
diff --git a/libexec/bootpd/dovend.c b/libexec/bootpd/dovend.c
index cb0b4a0448c4..65543a2700c0 100644
--- a/libexec/bootpd/dovend.c
+++ b/libexec/bootpd/dovend.c
@@ -15,15 +15,6 @@
 #include <errno.h>
 #include <syslog.h>
 
-#ifndef USE_BFUNCS
-# include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-# define bcopy(a,b,c)    memcpy(b,a,c)
-# define bzero(p,l)      memset(p,0,l)
-# define bcmp(a,b,c)     memcmp(a,b,c)
-# define index           strchr
-#endif
-
 #include "bootp.h"
 #include "bootpd.h"
 #include "report.h"
diff --git a/libexec/bootpd/dumptab.c b/libexec/bootpd/dumptab.c
index 43e94ec4cef2..daab93f609a6 100644
--- a/libexec/bootpd/dumptab.c
+++ b/libexec/bootpd/dumptab.c
@@ -10,17 +10,10 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <strings.h>
 #include <syslog.h>
 #include <time.h>
 
-#ifndef USE_BFUNCS
-#include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-#define bcopy(a,b,c)    memcpy(b,a,c)
-#define bzero(p,l)      memset(p,0,l)
-#define bcmp(a,b,c)     memcmp(a,b,c)
-#endif
-
 #include "bootp.h"
 #include "hash.h"
 #include "hwaddr.h"
diff --git a/libexec/bootpd/hash.c b/libexec/bootpd/hash.c
index 64f49d3b957d..1641a8a092cd 100644
--- a/libexec/bootpd/hash.c
+++ b/libexec/bootpd/hash.c
@@ -37,14 +37,7 @@ SOFTWARE.
 
 #include <sys/types.h>
 #include <stdlib.h>
-
-#ifndef USE_BFUNCS
-#include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-#define bcopy(a,b,c)    memcpy(b,a,c)
-#define bzero(p,l)      memset(p,0,l)
-#define bcmp(a,b,c)     memcmp(a,b,c)
-#endif
+#include <strings.h>
 
 #include "hash.h"
 
diff --git a/libexec/bootpd/hwaddr.c b/libexec/bootpd/hwaddr.c
index ff996157b911..293c75a6b3be 100644
--- a/libexec/bootpd/hwaddr.c
+++ b/libexec/bootpd/hwaddr.c
@@ -38,14 +38,6 @@
 #endif
 #include <syslog.h>
 
-#ifndef USE_BFUNCS
-/* Yes, memcpy is OK here (no overlapped copies). */
-#include <memory.h>
-#define bcopy(a,b,c)    memcpy(b,a,c)
-#define bzero(p,l)      memset(p,0,l)
-#define bcmp(a,b,c)     memcmp(a,b,c)
-#endif
-
 #ifndef	ATF_INUSE	/* Not defined on some systems (i.e. Linux) */
 #define	ATF_INUSE 0
 #endif
diff --git a/libexec/bootpd/lookup.c b/libexec/bootpd/lookup.c
index 54b3f62242f7..391a1d826d6e 100644
--- a/libexec/bootpd/lookup.c
+++ b/libexec/bootpd/lookup.c
@@ -17,14 +17,9 @@ extern int ether_hostton();
 #endif
 
 #include <netdb.h>
+#include <strings.h>
 #include <syslog.h>
 
-#ifndef USE_BFUNCS
-#include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-#define bcopy(a,b,c)    memcpy(b,a,c)
-#endif
-
 #include "bootp.h"
 #include "lookup.h"
 #include "report.h"
diff --git a/libexec/bootpd/readfile.c b/libexec/bootpd/readfile.c
index 900d0377279f..c09639300310 100644
--- a/libexec/bootpd/readfile.c
+++ b/libexec/bootpd/readfile.c
@@ -46,14 +46,6 @@ SOFTWARE.
 #include <assert.h>
 #include <syslog.h>
 
-#ifndef USE_BFUNCS
-#include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-#define	bcopy(a,b,c)	memcpy(b,a,c)
-#define	bzero(p,l)	memset(p,0,l)
-#define	bcmp(a,b,c)	memcmp(a,b,c)
-#endif
-
 #include "bootp.h"
 #include "hash.h"
 #include "hwaddr.h"
diff --git a/libexec/bootpd/tools/bootpef/bootpef.c b/libexec/bootpd/tools/bootpef/bootpef.c
index 04089c87b560..7ed3786d892e 100644
--- a/libexec/bootpd/tools/bootpef/bootpef.c
+++ b/libexec/bootpd/tools/bootpef/bootpef.c
@@ -55,14 +55,6 @@ SOFTWARE.
 #include <ctype.h>
 #include <syslog.h>
 
-#ifndef	USE_BFUNCS
-#include <memory.h>
-/* Yes, memcpy is OK here (no overlapped copies). */
-#define bcopy(a,b,c)    memcpy(b,a,c)
-#define bzero(p,l)      memset(p,0,l)
-#define bcmp(a,b,c)     memcmp(a,b,c)
-#endif
-
 #include "bootp.h"
 #include "hash.h"
 #include "hwaddr.h"
diff --git a/libexec/bootpd/tools/bootptest/bootptest.h b/libexec/bootpd/tools/bootptest/bootptest.h
index 2df35dea7ffc..2d9e451bddef 100644
--- a/libexec/bootpd/tools/bootptest/bootptest.h
+++ b/libexec/bootpd/tools/bootptest/bootptest.h
@@ -6,14 +6,6 @@
 #define ESRC(p) (p)
 #define EDST(p) (p)
 
-#ifndef	USE_BFUNCS
-/* Use mem/str functions */
-/* There are no overlapped copies, so memcpy is OK. */
-#define bcopy(a,b,c)    memcpy(b,a,c)
-#define bzero(p,l)      memset(p,0,l)
-#define bcmp(a,b,c)     memcmp(a,b,c)
-#endif
-
 extern int vflag; /* verbose flag */
 
 /* global pointers to beginning and end of current packet (during printing) */


More information about the dev-commits-src-all mailing list