svn commit: r297865 - in head/libexec/bootpd: . tools/bootptest

Pedro F. Giffuni pfg at FreeBSD.org
Tue Apr 12 18:18:28 UTC 2016


Author: pfg
Date: Tue Apr 12 18:18:26 2016
New Revision: 297865
URL: https://svnweb.freebsd.org/changeset/base/297865

Log:
  bootpd(8): De-register and minor cleanups.
  
  For bootptest(8) also remuve an unused variable and replace
  0 with a NULL for a pointer.

Modified:
  head/libexec/bootpd/getether.c
  head/libexec/bootpd/hash.c
  head/libexec/bootpd/hwaddr.c
  head/libexec/bootpd/readfile.c
  head/libexec/bootpd/rtmsg.c
  head/libexec/bootpd/tools/bootptest/bootptest.c
  head/libexec/bootpd/tools/bootptest/print-bootp.c

Modified: head/libexec/bootpd/getether.c
==============================================================================
--- head/libexec/bootpd/getether.c	Tue Apr 12 18:13:24 2016	(r297864)
+++ head/libexec/bootpd/getether.c	Tue Apr 12 18:18:26 2016	(r297865)
@@ -124,10 +124,10 @@ getether(ifname, eap)
 	char *eap;					/* Ether address (output) */
 {
 	int fd, rc = -1;
-	register int n;
+	int n;
 	struct ifreq ibuf[16];
 	struct ifconf ifc;
-	register struct ifreq *ifrp, *ifend;
+	struct ifreq *ifrp, *ifend;
 
 	/* Fetch the interface configuration */
 	fd = socket(AF_INET, SOCK_DGRAM, 0);

Modified: head/libexec/bootpd/hash.c
==============================================================================
--- head/libexec/bootpd/hash.c	Tue Apr 12 18:13:24 2016	(r297864)
+++ head/libexec/bootpd/hash.c	Tue Apr 12 18:18:26 2016	(r297865)
@@ -79,8 +79,8 @@ hash_tbl *
 hash_Init(tablesize)
 	unsigned tablesize;
 {
-	register hash_tbl *hashtblptr;
-	register unsigned totalsize;
+	hash_tbl *hashtblptr;
+	unsigned totalsize;
 
 	if (tablesize > 0) {
 		totalsize = sizeof(hash_tbl)
@@ -169,9 +169,9 @@ hash_Reset(hashtable, free_data)
 unsigned
 hash_HashFunction(string, len)
 	unsigned char *string;
-	register unsigned len;
+	unsigned len;
 {
-	register unsigned accum;
+	unsigned accum;
 
 	accum = 0;
 	for (; len > 0; len--) {
@@ -195,7 +195,7 @@ hash_Exists(hashtable, hashcode, compare
 	hash_cmpfp compare;
 	hash_datum *key;
 {
-	register hash_member *memberptr;
+	hash_member *memberptr;
 
 	memberptr = (hashtable->table)[hashcode % (hashtable->size)];
 	while (memberptr) {
@@ -345,8 +345,8 @@ hash_datum *
 hash_NextEntry(hashtable)
 	hash_tbl *hashtable;
 {
-	register unsigned bucket;
-	register hash_member *memberptr;
+	unsigned bucket;
+	hash_member *memberptr;
 
 	/*
 	 * First try to pick up where we left off.

Modified: head/libexec/bootpd/hwaddr.c
==============================================================================
--- head/libexec/bootpd/hwaddr.c	Tue Apr 12 18:13:24 2016	(r297864)
+++ head/libexec/bootpd/hwaddr.c	Tue Apr 12 18:18:26 2016	(r297865)
@@ -295,7 +295,7 @@ static u_char conv802table[256] =
 
 void
 haddr_conv802(addr_in, addr_out, len)
-	register u_char *addr_in, *addr_out;
+	u_char *addr_in, *addr_out;
 	int len;
 {
 	u_char *lim;

Modified: head/libexec/bootpd/readfile.c
==============================================================================
--- head/libexec/bootpd/readfile.c	Tue Apr 12 18:13:24 2016	(r297864)
+++ head/libexec/bootpd/readfile.c	Tue Apr 12 18:18:26 2016	(r297865)
@@ -428,7 +428,7 @@ readtab(force)
 		if (hp->flags.iaddr) {
 			nhosts++;
 		}
-		/* Register by HW addr if known. */
+		/* by HW addr if known. */
 		if (hp->flags.htype && hp->flags.haddr) {
 			/* We will either insert it or free it. */
 			hp->linkcount++;
@@ -441,7 +441,7 @@ readtab(force)
 				continue;
 			}
 		}
-		/* Register by IP addr if known. */
+		/* by IP addr if known. */
 		if (hp->flags.iaddr) {
 			hashcode = hash_HashFunction((u_char *) & (hp->iaddr.s_addr), 4);
 			if (hash_Insert(iphashtable, hashcode, nullcmp, hp, hp) < 0) {
@@ -452,7 +452,7 @@ readtab(force)
 				hp->linkcount++;
 			}
 		}
-		/* Register by Name (always known) */
+		/* by Name (always known) */
 		hashcode = hash_HashFunction((u_char *) hp->hostname->string,
 									 strlen(hp->hostname->string));
 		if (hash_Insert(nmhashtable, hashcode, nullcmp,
@@ -1305,7 +1305,7 @@ process_generic(src, dest, tagvalue)
 
 PRIVATE boolean
 goodname(hostname)
-	register char *hostname;
+	char *hostname;
 {
 	do {
 		if (!isalpha(*hostname++)) {	/* First character must be a letter */
@@ -1524,7 +1524,7 @@ PRIVATE void
 adjust(s)
 	char **s;
 {
-	register char *t;
+	char *t;
 
 	t = *s;
 	while (*t && (*t != ':')) {
@@ -1549,7 +1549,7 @@ PRIVATE void
 eat_whitespace(s)
 	char **s;
 {
-	register char *t;
+	char *t;
 
 	t = *s;
 	while (*t && isspace(*t)) {
@@ -1668,7 +1668,7 @@ prs_inetaddr(src, result)
 	u_int32 *result;
 {
 	char tmpstr[MAXSTRINGLEN];
-	register u_int32 value;
+	u_int32 value;
 	u_int32 parts[4], *pp;
 	int n;
 	char *s, *t;
@@ -1853,7 +1853,7 @@ PRIVATE u_int32
 get_u_long(src)
 	char **src;
 {
-	register u_int32 value, base;
+	u_int32 value, base;
 	char c;
 
 	/*

Modified: head/libexec/bootpd/rtmsg.c
==============================================================================
--- head/libexec/bootpd/rtmsg.c	Tue Apr 12 18:13:24 2016	(r297864)
+++ head/libexec/bootpd/rtmsg.c	Tue Apr 12 18:18:26 2016	(r297865)
@@ -118,9 +118,9 @@ int bsd_arp_set(ia, eaddr, len)
 	char *eaddr;
 	int len;
 {
-	register struct sockaddr_in *sin = &sin_m;
-	register struct sockaddr_dl *sdl;
-	register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm);
+	struct sockaddr_in *sin = &sin_m;
+	struct sockaddr_dl *sdl;
+	struct rt_msghdr *rtm = &(m_rtmsg.m_rtm);
 	u_char *ea;
 	struct timespec tp;
 	int op = RTM_ADD;
@@ -179,9 +179,9 @@ static int rtmsg(cmd)
 {
 	static int seq;
 	int rlen;
-	register struct rt_msghdr *rtm = &m_rtmsg.m_rtm;
-	register char *cp = m_rtmsg.m_space;
-	register int l;
+	struct rt_msghdr *rtm = &m_rtmsg.m_rtm;
+	char *cp = m_rtmsg.m_space;
+	int l;
 
 	errno = 0;
 	bzero((char *)&m_rtmsg, sizeof(m_rtmsg));

Modified: head/libexec/bootpd/tools/bootptest/bootptest.c
==============================================================================
--- head/libexec/bootpd/tools/bootptest/bootptest.c	Tue Apr 12 18:13:24 2016	(r297864)
+++ head/libexec/bootpd/tools/bootptest/bootptest.c	Tue Apr 12 18:18:26 2016	(r297865)
@@ -466,9 +466,9 @@ send_request(s)
  */
 int
 printfn(s, ep)
-	register u_char *s, *ep;
+	u_char *s, *ep;
 {
-	register u_char c;
+	u_char c;
 
 	putchar('"');
 	while ((c = *s++) != '\0') {

Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c
==============================================================================
--- head/libexec/bootpd/tools/bootptest/print-bootp.c	Tue Apr 12 18:13:24 2016	(r297864)
+++ head/libexec/bootpd/tools/bootptest/print-bootp.c	Tue Apr 12 18:18:26 2016	(r297865)
@@ -100,8 +100,8 @@ bootp_print(bp, length, sport, dport)
 
 	/* Client's Hardware address */
 	if (bp->bp_hlen) {
-		register struct ether_header *eh;
-		register char *e;
+		struct ether_header *eh;
+		char *e;
 
 		TCHECK(bp->bp_chaddr[0], 6);
 		eh = (struct ether_header *) packetp;
@@ -110,8 +110,8 @@ bootp_print(bp, length, sport, dport)
 		else if (bp->bp_op == BOOTREPLY)
 			e = (char *) EDST(eh);
 		else
-			e = 0;
-		if (e == 0 || bcmp((char *) bp->bp_chaddr, e, 6))
+			e = NULL;
+		if (e == NULL || bcmp((char *) bp->bp_chaddr, e, 6))
 			dump_hex(bp->bp_chaddr, bp->bp_hlen);
 	}
 	/* Only print interesting fields */
@@ -274,12 +274,12 @@ rfc1048_opts[] = {
 
 static void
 rfc1048_print(bp, length)
-	register u_char *bp;
+	u_char *bp;
 	int length;
 {
 	u_char tag;
 	u_char *ep;
-	register int len;
+	int len;
 	u_int32 ul;
 	u_short us;
 	struct in_addr ia;
@@ -376,11 +376,10 @@ rfc1048_print(bp, length)
 
 static void
 cmu_print(bp, length)
-	register u_char *bp;
+	u_char *bp;
 	int length;
 {
 	struct cmu_vend *v;
-	u_char *ep;
 
 	printf("-cmu");
 
@@ -389,8 +388,6 @@ cmu_print(bp, length)
 		printf(" |L=%d", length);
 		return;
 	}
-	/* Setup end pointer */
-	ep = bp + length;
 
 	/* Subnet mask */
 	if (v->v_flags & VF_SMASK) {
@@ -427,7 +424,7 @@ cmu_print(bp, length)
 
 static void
 other_print(bp, length)
-	register u_char *bp;
+	u_char *bp;
 	int length;
 {
 	u_char *ep;					/* end pointer */


More information about the svn-src-all mailing list