summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorbket <bket@cvs.openbsd.org>2020-06-26 19:00:09 +0000
committerbket <bket@cvs.openbsd.org>2020-06-26 19:00:09 +0000
commitad6301efab7482ca0ebb79e7af13194107801e3c (patch)
treee4a32f9d78025b36debe6ecac617cf0ff99f9d60 /usr.sbin
parentbad488f6082bf81f22c19e0f22bba6adae223c0c (diff)
Replace SIMPLEQ concatenation loops with SIMPLEQ_CONCAT
As a result *ra_rdnss and *ra_dnssl are not used any more, and can be removed. While here remove spurious space. OK florian@, millert@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rad/rad.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/usr.sbin/rad/rad.c b/usr.sbin/rad/rad.c
index 365637d49e7..6d4e18c1215 100644
--- a/usr.sbin/rad/rad.c
+++ b/usr.sbin/rad/rad.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rad.c,v 1.22 2020/03/30 17:47:48 florian Exp $ */
+/* $OpenBSD: rad.c,v 1.23 2020/06/26 19:00:08 bket Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -433,7 +433,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
case IMSG_CTL_LOG_VERBOSE:
if (IMSG_DATA_SIZE(imsg) != sizeof(verbose))
fatalx("%s: IMSG_CTL_LOG_VERBOSE wrong length: "
- "%lu", __func__, IMSG_DATA_SIZE(imsg));
+ "%lu", __func__, IMSG_DATA_SIZE(imsg));
memcpy(&verbose, imsg.data, sizeof(verbose));
log_setverbose(verbose);
break;
@@ -703,8 +703,6 @@ void
merge_config(struct rad_conf *conf, struct rad_conf *xconf)
{
struct ra_iface_conf *ra_iface_conf;
- struct ra_rdnss_conf *ra_rdnss;
- struct ra_dnssl_conf *ra_dnssl;
/* Remove & discard existing interfaces. */
while ((ra_iface_conf = SIMPLEQ_FIRST(&conf->ra_iface_list)) != NULL) {
@@ -718,24 +716,13 @@ merge_config(struct rad_conf *conf, struct rad_conf *xconf)
SIMPLEQ_INIT(&conf->ra_options.ra_dnssl_list);
/* Add new interfaces. */
- while ((ra_iface_conf = SIMPLEQ_FIRST(&xconf->ra_iface_list)) != NULL) {
- SIMPLEQ_REMOVE_HEAD(&xconf->ra_iface_list, entry);
- SIMPLEQ_INSERT_TAIL(&conf->ra_iface_list, ra_iface_conf, entry);
- }
+ SIMPLEQ_CONCAT(&conf->ra_iface_list, &xconf->ra_iface_list);
/* Add dns options */
- while ((ra_rdnss = SIMPLEQ_FIRST(&xconf->ra_options.ra_rdnss_list))
- != NULL) {
- SIMPLEQ_REMOVE_HEAD(&xconf->ra_options.ra_rdnss_list, entry);
- SIMPLEQ_INSERT_TAIL(&conf->ra_options.ra_rdnss_list, ra_rdnss,
- entry);
- }
- while ((ra_dnssl = SIMPLEQ_FIRST(&xconf->ra_options.ra_dnssl_list))
- != NULL) {
- SIMPLEQ_REMOVE_HEAD(&xconf->ra_options.ra_dnssl_list, entry);
- SIMPLEQ_INSERT_TAIL(&conf->ra_options.ra_dnssl_list, ra_dnssl,
- entry);
- }
+ SIMPLEQ_CONCAT(&conf->ra_options.ra_rdnss_list,
+ &xconf->ra_options.ra_rdnss_list);
+ SIMPLEQ_CONCAT(&conf->ra_options.ra_dnssl_list,
+ &xconf->ra_options.ra_dnssl_list);
free(xconf);
}