+// SPDX-License-Identifier: GPL-2.0-or-later
/* Zebra SR-TE code
* Copyright (C) 2020 NetDEF, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
stream_putc(s, IPV6_MAX_BITLEN);
stream_put(s, &policy->endpoint.ipaddr_v6, IPV6_MAX_BYTELEN);
break;
- default:
+ case IPADDR_NONE:
flog_warn(EC_LIB_DEVELOPMENT,
"%s: unknown policy endpoint address family: %u",
__func__, policy->endpoint.ipa_type);
p.prefixlen = IPV6_MAX_BITLEN;
p.u.prefix6 = policy->endpoint.ipaddr_v6;
break;
- default:
+ case IPADDR_NONE:
flog_warn(EC_LIB_DEVELOPMENT,
"%s: unknown policy endpoint address family: %u",
__func__, policy->endpoint.ipa_type);
static int zebra_srte_client_close_cleanup(struct zserv *client)
{
int sock = client->sock;
- struct zebra_sr_policy *policy;
+ struct zebra_sr_policy *policy, *policy_temp;
if (!sock)
return 0;
- RB_FOREACH (policy, zebra_sr_policy_instance_head,
- &zebra_sr_policy_instances) {
+ RB_FOREACH_SAFE (policy, zebra_sr_policy_instance_head,
+ &zebra_sr_policy_instances, policy_temp) {
if (policy->sock == sock)
zebra_sr_policy_del(policy);
}