The CIRCLEQ API from sys/queue.h is deprecated since NetBSD 7 and
it will be removed soon. The CIRCLEQ API implementation is prone
to a miscompilation due to the pointer aliasing and is discouraged.
---
 usr.sbin/ypserv/ypserv/ypserv_db.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/usr.sbin/ypserv/ypserv/ypserv_db.c 
b/usr.sbin/ypserv/ypserv/ypserv_db.c
index d6f9eda39eaa..9edfabc4f675 100644
--- a/usr.sbin/ypserv/ypserv/ypserv_db.c
+++ b/usr.sbin/ypserv/ypserv/ypserv_db.c
@@ -65,7 +65,7 @@ __RCSID("$NetBSD: ypserv_db.c,v 1.22 2011/02/01 21:00:25 
chuck Exp $");
 
 LIST_HEAD(domainlist, opt_domain);     /* LIST of domains */
 LIST_HEAD(maplist, opt_map);           /* LIST of maps (in a domain) */
-CIRCLEQ_HEAD(mapq, opt_map);           /* CIRCLEQ of maps (LRU) */
+TAILQ_HEAD(mapq, opt_map);             /* TAILQ of maps (LRU) */
 
 struct opt_map {
        char    *map;                   /* map name (malloc'd) */
@@ -76,7 +76,7 @@ struct opt_map {
        dev_t   dbdev;                  /* device db is on */
        ino_t   dbino;                  /* inode of db */
        time_t  dbmtime;                /* time of last db modification */
-       CIRCLEQ_ENTRY(opt_map) mapsq;   /* map queue pointers */
+       TAILQ_ENTRY(opt_map) mapsq;     /* map queue pointers */
        LIST_ENTRY(opt_map) mapsl;      /* map list pointers */
 };
 
@@ -106,7 +106,7 @@ ypdb_init(void)
 {
 
        LIST_INIT(&doms);
-       CIRCLEQ_INIT(&maps);
+       TAILQ_INIT(&maps);
 }
 
 /*
@@ -161,7 +161,7 @@ yp_private(datum key, int ypprivate)
 void
 ypdb_close_map(struct opt_map *map)
 {
-       CIRCLEQ_REMOVE(&maps, map, mapsq);      /* remove from LRU circleq */
+       TAILQ_REMOVE(&maps, map, mapsq);        /* remove from LRU tailq */
        LIST_REMOVE(map, mapsl);                /* remove from domain list */
 
 #ifdef DEBUG
@@ -326,8 +326,8 @@ ypdb_open_db(const char *domain, const char *map, u_int 
*status,
                 */
                if (finfo.st_dev == m->dbdev && finfo.st_ino == m->dbino &&
                    finfo.st_mtime == m->dbmtime) {
-                       CIRCLEQ_REMOVE(&maps, m, mapsq); /* adjust LRU queue */
-                       CIRCLEQ_INSERT_HEAD(&maps, m, mapsq);
+                       TAILQ_REMOVE(&maps, m, mapsq); /* adjust LRU queue */
+                       TAILQ_INSERT_HEAD(&maps, m, mapsq);
                        if (map_info)
                                *map_info = m;
                        return (m->db);
@@ -423,7 +423,7 @@ retryopen:
        m->dbdev = finfo.st_dev;
        m->dbino = finfo.st_ino;
        m->dbmtime = finfo.st_mtime;
-       CIRCLEQ_INSERT_HEAD(&maps, m, mapsq);
+       TAILQ_INSERT_HEAD(&maps, m, mapsq);
        LIST_INSERT_HEAD(&d->dmaps, m, mapsl);
        if (strcmp(map, YP_HOSTNAME) == 0 || strcmp(map, YP_HOSTADDR) == 0) {
                if (!usedns) {
-- 
2.28.0

Reply via email to