summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/zclient.c4
-rw-r--r--lib/zclient.h5
-rw-r--r--sharpd/sharp_nht.c2
-rw-r--r--sharpd/sharp_vty.c6
-rw-r--r--sharpd/sharp_zebra.c8
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/zapi_msg.c59
-rw-r--r--zebra/zebra_vty.c14
8 files changed, 48 insertions, 52 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 2e65e3c9f..dfb409426 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1053,8 +1053,8 @@ static void zclient_nhg_writer(struct stream *s, uint16_t proto, int cmd,
stream_putw_at(s, 0, stream_get_endp(s));
}
-extern void zclient_nhg_add(struct zclient *zclient, uint32_t id,
- size_t nhops, struct zapi_nexthop *znh)
+extern void zclient_nhg_add(struct zclient *zclient, uint32_t id, size_t nhops,
+ struct zapi_nexthop *znh)
{
struct stream *s = zclient->obuf;
diff --git a/lib/zclient.h b/lib/zclient.h
index 3ac9ca945..0fbe1de29 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -374,7 +374,7 @@ struct zclient {
#define ZAPI_MESSAGE_SRCPFX 0x20
/* Backup nexthops are present */
#define ZAPI_MESSAGE_BACKUP_NEXTHOPS 0x40
-#define ZAPI_MESSAGE_NHG 0x80
+#define ZAPI_MESSAGE_NHG 0x80
/*
* This should only be used by a DAEMON that needs to communicate
@@ -898,8 +898,7 @@ bool zapi_ipset_notify_decode(struct stream *s,
uint32_t *unique,
enum zapi_ipset_notify_owner *note);
-extern void zclient_nhg_add(struct zclient *zclient,
- uint32_t id, size_t nhops,
+extern void zclient_nhg_add(struct zclient *zclient, uint32_t id, size_t nhops,
struct zapi_nexthop *znh);
extern void zclient_nhg_del(struct zclient *zclient, uint32_t id);
diff --git a/sharpd/sharp_nht.c b/sharpd/sharp_nht.c
index 4c32dc279..38de8f217 100644
--- a/sharpd/sharp_nht.c
+++ b/sharpd/sharp_nht.c
@@ -109,7 +109,7 @@ static struct sharp_nhg *sharp_nhgroup_find_id(uint32_t id)
* to sharpd with another RB tree for just IDs
*/
- frr_each(sharp_nhg_rb, &nhg_head, lookup) {
+ frr_each (sharp_nhg_rb, &nhg_head, lookup) {
if (lookup->id == id)
return lookup;
}
diff --git a/sharpd/sharp_vty.c b/sharpd/sharp_vty.c
index 2903588c1..d062f027a 100644
--- a/sharpd/sharp_vty.c
+++ b/sharpd/sharp_vty.c
@@ -299,9 +299,9 @@ DEFPY (install_routes,
sg.r.inst = instance;
sg.r.vrf_id = vrf->vrf_id;
rts = routes;
- sharp_install_routes_helper(&prefix, sg.r.vrf_id, sg.r.inst,
- nhgid, &sg.r.nhop_group,
- &sg.r.backup_nhop_group, rts);
+ sharp_install_routes_helper(&prefix, sg.r.vrf_id, sg.r.inst, nhgid,
+ &sg.r.nhop_group, &sg.r.backup_nhop_group,
+ rts);
return CMD_SUCCESS;
}
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index 6be1176db..03def0d9b 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -288,8 +288,7 @@ static void handle_repeated(bool installed)
if (!installed) {
sg.r.installed_routes = 0;
sharp_install_routes_helper(&p, sg.r.vrf_id, sg.r.inst,
- sg.r.nhgid,
- &sg.r.nhop_group,
+ sg.r.nhgid, &sg.r.nhop_group,
&sg.r.backup_nhop_group,
sg.r.total_routes);
}
@@ -383,9 +382,8 @@ void nhg_del(uint32_t id)
zclient_send_message(zclient);
}
-void route_add(const struct prefix *p, vrf_id_t vrf_id,
- uint8_t instance, uint32_t nhgid,
- const struct nexthop_group *nhg,
+void route_add(const struct prefix *p, vrf_id_t vrf_id, uint8_t instance,
+ uint32_t nhgid, const struct nexthop_group *nhg,
const struct nexthop_group *backup_nhg)
{
struct zapi_route api;
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 46de751f9..1ce3c435f 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -2269,7 +2269,7 @@ nexthop_done:
nh->vrf_id, label_buf);
}
- req->nhm.nh_protocol = zebra2proto(type);
+req->nhm.nh_protocol = zebra2proto(type);
} else if (cmd != RTM_DELNEXTHOP) {
flog_err(
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 5bf8fd302..0e4270079 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -1508,8 +1508,7 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh,
memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4),
sizeof(struct in_addr));
zebra_vxlan_evpn_vrf_route_add(
- api_nh->vrf_id, &api_nh->rmac,
- &vtep_ip, p);
+ api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p);
}
break;
case NEXTHOP_TYPE_IPV6:
@@ -1542,8 +1541,7 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh,
memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6),
sizeof(struct in6_addr));
zebra_vxlan_evpn_vrf_route_add(
- api_nh->vrf_id, &api_nh->rmac,
- &vtep_ip, p);
+ api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p);
}
break;
case NEXTHOP_TYPE_BLACKHOLE:
@@ -1660,7 +1658,8 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p,
return false;
}
- if (bnhg && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP)) {
+ if (bnhg
+ && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP)) {
if (IS_ZEBRA_DEBUG_RECV) {
nexthop2str(nexthop, nhbuf, sizeof(nhbuf));
zlog_debug("%s: backup nh %s with BACKUP flag!",
@@ -1707,18 +1706,19 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p,
if (png) {
/* Add new nexthop to temporary list. This list is
- * canonicalized - sorted - so that it can be hashed later
- * in route processing. We expect that the sender has sent
- * the list sorted, and the zapi client api attempts to enforce
- * that, so this should be inexpensive - but it is necessary
- * to support shared nexthop-groups.
+ * canonicalized - sorted - so that it can be hashed
+ * later in route processing. We expect that the sender
+ * has sent the list sorted, and the zapi client api
+ * attempts to enforce that, so this should be
+ * inexpensive - but it is necessary to support shared
+ * nexthop-groups.
*/
nexthop_group_add_sorted(ng, nexthop);
}
if (bnhg) {
- /* Note that the order of the backup nexthops is significant,
- * so we don't sort this list as we do the primary nexthops,
- * we just append.
+ /* Note that the order of the backup nexthops is
+ * significant, so we don't sort this list as we do the
+ * primary nexthops, we just append.
*/
if (last_nh)
NEXTHOP_APPEND(last_nh, nexthop);
@@ -1792,8 +1792,7 @@ static void zread_nhg_add(ZAPI_HANDLER_ARGS)
if (zapi_nexthop_decode(s, znh, 0, 0) != 0) {
flog_warn(EC_ZEBRA_NEXTHOP_CREATION_FAILED,
- "%s: Nexthop creation failed",
- __func__);
+ "%s: Nexthop creation failed", __func__);
return;
}
}
@@ -1801,8 +1800,7 @@ static void zread_nhg_add(ZAPI_HANDLER_ARGS)
if (!zapi_read_nexthops(client, NULL, zapi_nexthops, 0, 0, nhops, 0,
&nhg, NULL)) {
flog_warn(EC_ZEBRA_NEXTHOP_CREATION_FAILED,
- "%s: Nexthop Group Creation failed",
- __func__);
+ "%s: Nexthop Group Creation failed", __func__);
return;
}
@@ -1827,9 +1825,10 @@ static void zread_nhg_add(ZAPI_HANDLER_ARGS)
return;
stream_failure:
- flog_warn(EC_ZEBRA_NEXTHOP_CREATION_FAILED,
- "%s: Nexthop Group creation failed with some sort of stream read failure",
- __func__);
+ flog_warn(
+ EC_ZEBRA_NEXTHOP_CREATION_FAILED,
+ "%s: Nexthop Group creation failed with some sort of stream read failure",
+ __func__);
return;
}
@@ -1881,22 +1880,24 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
if (!CHECK_FLAG(api.message, ZAPI_MESSAGE_NHG)
&& (!CHECK_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP)
|| api.nexthop_num == 0)) {
- flog_warn(EC_ZEBRA_RX_ROUTE_NO_NEXTHOPS,
- "%s: received a route without nexthops for prefix %pFX from client %s",
- __func__, &api.prefix,
- zebra_route_string(client->proto));
+ flog_warn(
+ EC_ZEBRA_RX_ROUTE_NO_NEXTHOPS,
+ "%s: received a route without nexthops for prefix %pFX from client %s",
+ __func__, &api.prefix,
+ zebra_route_string(client->proto));
XFREE(MTYPE_RE, re);
return;
}
/* Report misuse of the backup flag */
- if (CHECK_FLAG(api.message, ZAPI_MESSAGE_BACKUP_NEXTHOPS) &&
- api.backup_nexthop_num == 0) {
+ if (CHECK_FLAG(api.message, ZAPI_MESSAGE_BACKUP_NEXTHOPS)
+ && api.backup_nexthop_num == 0) {
if (IS_ZEBRA_DEBUG_RECV || IS_ZEBRA_DEBUG_EVENT)
- zlog_debug("%s: client %s: BACKUP flag set but no backup nexthops, prefix %pFX",
- __func__,
- zebra_route_string(client->proto), &api.prefix);
+ zlog_debug(
+ "%s: client %s: BACKUP flag set but no backup nexthops, prefix %pFX",
+ __func__, zebra_route_string(client->proto),
+ &api.prefix);
}
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_NHG))
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 7e73b3f72..678515170 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -1566,14 +1566,12 @@ DEFPY_HIDDEN(nexthop_group_use_enable,
return CMD_SUCCESS;
}
-DEFPY_HIDDEN (proto_nexthop_group_only,
- proto_nexthop_group_only_cmd,
- "[no] zebra nexthop proto only",
- NO_STR
- ZEBRA_STR
- "Nexthop configuration\n"
- "Configure exclusive use of proto nexthops\n"
- "Only use proto nexthops\n")
+DEFPY_HIDDEN(proto_nexthop_group_only, proto_nexthop_group_only_cmd,
+ "[no] zebra nexthop proto only",
+ NO_STR ZEBRA_STR
+ "Nexthop configuration\n"
+ "Configure exclusive use of proto nexthops\n"
+ "Only use proto nexthops\n")
{
zebra_nhg_set_proto_nexthops_only(!no);
return CMD_SUCCESS;