Replace custom TAILQ concatenation loop by TAILQ_CONCAT(3).

Comments/OK?


diff --git usr.sbin/bgpd/config.c usr.sbin/bgpd/config.c
index cb43afb81fe..fc81a3efd3b 100644
--- usr.sbin/bgpd/config.c
+++ usr.sbin/bgpd/config.c
@@ -195,7 +195,6 @@ void
 merge_config(struct bgpd_config *xconf, struct bgpd_config *conf)
 {
        struct listen_addr      *nla, *ola, *next;
-       struct network          *n;
        struct peer             *p, *np, *nextp;
 
        /*
@@ -250,10 +249,7 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config 
*conf)
 
        /* switch the network statements, but first remove the old ones */
        free_networks(&xconf->networks);
-       while ((n = TAILQ_FIRST(&conf->networks)) != NULL) {
-               TAILQ_REMOVE(&conf->networks, n, entry);
-               TAILQ_INSERT_TAIL(&xconf->networks, n, entry);
-       }
+       TAILQ_CONCAT(&xconf->networks, &conf->networks, entry);
 
        /* switch the l3vpn configs, first remove the old ones */
        free_l3vpns(&xconf->l3vpns);

Reply via email to