+// SPDX-License-Identifier: GPL-2.0-or-later
/* Kernel communication using routing socket.
* Copyright (C) 1999 Kunihiro Ishiguro
- *
- * 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>
/* paranoia: sanity check structure */
if (ifm->ifm_msglen < sizeof(struct if_msghdr)) {
flog_err(EC_ZEBRA_NETLINK_LENGTH_ERROR,
- "ifm_read: ifm->ifm_msglen %d too short",
+ "%s: ifm->ifm_msglen %d too short", __func__,
ifm->ifm_msglen);
return -1;
}
} else
return;
- /*
- * CHANGE: delete the old prefix, we have no further information
- * to specify the route really
- */
- if (rtm->rtm_type == RTM_CHANGE)
- rib_delete(afi, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL,
- 0, zebra_flags, &p, NULL, NULL, 0, RT_TABLE_MAIN, 0,
- 0, true);
if (rtm->rtm_type == RTM_GET || rtm->rtm_type == RTM_ADD
|| rtm->rtm_type == RTM_CHANGE)
rib_add(afi, SAFI_UNICAST, VRF_DEFAULT, proto, 0, zebra_flags,
case BLACKHOLE_REJECT:
msg.rtm.rtm_flags |= RTF_REJECT;
break;
- default:
+ case BLACKHOLE_NULL:
+ case BLACKHOLE_ADMINPROHIB:
msg.rtm.rtm_flags |= RTF_BLACKHOLE;
break;
}
* can assume they have the whole message.
*/
if (rtm->rtm_msglen != nbytes) {
- zlog_debug(
- "kernel_read: rtm->rtm_msglen %d, nbytes %d, type %d",
- rtm->rtm_msglen, nbytes, rtm->rtm_type);
+ zlog_debug("%s: rtm->rtm_msglen %d, nbytes %d, type %d",
+ __func__, rtm->rtm_msglen, nbytes, rtm->rtm_type);
return;
}
return 0;
}
-void kernel_update_multi(struct dplane_ctx_q *ctx_list)
+void kernel_update_multi(struct dplane_ctx_list_head *ctx_list)
{
struct zebra_dplane_ctx *ctx;
- struct dplane_ctx_q handled_list;
+ struct dplane_ctx_list_head handled_list;
enum zebra_dplane_result res = ZEBRA_DPLANE_REQUEST_SUCCESS;
- TAILQ_INIT(&handled_list);
+ dplane_ctx_q_init(&handled_list);
while (true) {
ctx = dplane_ctx_dequeue(ctx_list);
res = kernel_intf_update(ctx);
break;
- case DPLANE_OP_TC_INSTALL:
- case DPLANE_OP_TC_UPDATE:
- case DPLANE_OP_TC_DELETE:
+ case DPLANE_OP_TC_QDISC_INSTALL:
+ case DPLANE_OP_TC_QDISC_UNINSTALL:
+ case DPLANE_OP_TC_CLASS_ADD:
+ case DPLANE_OP_TC_CLASS_DELETE:
+ case DPLANE_OP_TC_CLASS_UPDATE:
+ case DPLANE_OP_TC_FILTER_ADD:
+ case DPLANE_OP_TC_FILTER_DELETE:
+ case DPLANE_OP_TC_FILTER_UPDATE:
res = kernel_tc_update(ctx);
break;
dplane_ctx_enqueue_tail(&handled_list, ctx);
}
- TAILQ_INIT(ctx_list);
+ dplane_ctx_q_init(ctx_list);
dplane_ctx_list_append(ctx_list, &handled_list);
}