/* SPDX-License-Identifier: LGPL-2.1+ */
/***
- This file is part of systemd.
-
- Copyright (C) 2014 Intel Corporation. All rights reserved.
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ Copyright © 2014 Intel Corporation. All rights reserved.
***/
#include <netinet/icmp6.h>
#include "ndisc-router.h"
#include "strv.h"
-_public_ sd_ndisc_router* sd_ndisc_router_ref(sd_ndisc_router *rt) {
- if (!rt)
- return NULL;
-
- assert(rt->n_ref > 0);
- rt->n_ref++;
-
- return rt;
-}
-
-_public_ sd_ndisc_router* sd_ndisc_router_unref(sd_ndisc_router *rt) {
- if (!rt)
- return NULL;
-
- assert(rt->n_ref > 0);
- rt->n_ref--;
-
- if (rt->n_ref > 0)
- return NULL;
-
- return mfree(rt);
-}
+DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC(sd_ndisc_router, sd_ndisc_router, mfree);
sd_ndisc_router *ndisc_router_new(size_t raw_size) {
sd_ndisc_router *rt;
if (has_mtu) {
log_ndisc("MTU option specified twice, ignoring.");
- continue;
+ break;
}
if (length != 8) {
if (has_flag_extension) {
log_ndisc("Flags extension option specified twice, ignoring.");
- continue;
+ break;
}
if (length < 1*8) {
_cleanup_free_ char *normalized = NULL;
e[n] = 0;
- r = dns_name_normalize(e, &normalized);
+ r = dns_name_normalize(e, 0, &normalized);
if (r < 0)
return r;