summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_mplsvpn.c2
-rw-r--r--bgpd/bgp_zebra.c3
-rw-r--r--lib/zclient.c9
-rw-r--r--sharpd/sharp_vty.c3
-rw-r--r--zebra/rt_netlink.c12
-rw-r--r--zebra/zapi_msg.c3
6 files changed, 13 insertions, 19 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 6162ec42a6..f99d672c8a 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -366,7 +366,7 @@ void vpn_leak_zebra_vrf_sid_update(struct bgp *bgp, afi_t afi)
{
int debug = BGP_DEBUG(vpn, VPN_LEAK_LABEL);
enum seg6local_action_t act;
- struct seg6local_context ctx = { {0} };
+ struct seg6local_context ctx = {};
struct in6_addr *tovpn_sid = NULL;
struct in6_addr *tovpn_sid_ls = NULL;
struct vrf *vrf;
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index df6f383fb7..a10c6fd245 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -3003,11 +3003,10 @@ static void bgp_zebra_process_srv6_locator_chunk(ZAPI_CALLBACK_ARGS)
struct bgp *bgp = bgp_get_default();
struct listnode *node;
struct prefix_ipv6 *c;
- struct srv6_locator_chunk s6c;
+ struct srv6_locator_chunk s6c = {};
struct prefix_ipv6 *chunk = NULL;
s = zclient->ibuf;
- memset(&s6c, 0, sizeof(s6c));
zapi_srv6_locator_chunk_decode(s, &s6c);
if (zclient->redist_default != s6c.proto) {
diff --git a/lib/zclient.c b/lib/zclient.c
index f6b97a768f..158a20eb58 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -441,16 +441,14 @@ enum zclient_send_status zclient_send_localsid(struct zclient *zclient,
enum seg6local_action_t action,
const struct seg6local_context *context)
{
- struct prefix_ipv6 p;
- struct zapi_route api;
- struct nexthop nh;
+ struct prefix_ipv6 p = {};
+ struct zapi_route api = {};
+ struct nexthop nh = {};
- memset(&p, 0, sizeof(p));
p.family = AF_INET6;
p.prefixlen = 128;
p.prefix = *sid;
- memset(&api, 0, sizeof(api));
api.vrf_id = VRF_DEFAULT;
api.type = ZEBRA_ROUTE_BGP;
api.instance = 0;
@@ -464,7 +462,6 @@ enum zclient_send_status zclient_send_localsid(struct zclient *zclient,
SET_FLAG(api.flags, ZEBRA_FLAG_SEG6LOCAL_ROUTE);
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
- memset(&nh, 0, sizeof(nh));
nh.type = NEXTHOP_TYPE_IFINDEX;
nh.ifindex = oif;
nexthop_add_seg6local(&nh, action, context);
diff --git a/sharpd/sharp_vty.c b/sharpd/sharp_vty.c
index 58f6e3fe95..72bc7d16b9 100644
--- a/sharpd/sharp_vty.c
+++ b/sharpd/sharp_vty.c
@@ -316,10 +316,9 @@ DEFPY (install_routes,
sg.r.backup_nhop_group.nexthop = bnhgc->nhg.nexthop;
}
} else if (seg6l_oif) {
- struct seg6local_context ctx;
+ struct seg6local_context ctx = {};
enum seg6local_action_t action;
- memset(&ctx, 0, sizeof(struct seg6local_context));
if (seg6l_enddx4) {
action = ZEBRA_SEG6_LOCAL_ACTION_END_DX4;
ctx.nh4 = seg6l_enddx4_nh4;
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index a84c3da6ad..70db6234bb 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -419,7 +419,7 @@ static enum seg6local_action_t
parse_encap_seg6local(struct rtattr *tb,
struct seg6local_context *ctx)
{
- struct rtattr *tb_encap[256] = {0};
+ struct rtattr *tb_encap[256] = {};
enum seg6local_action_t act = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
netlink_parse_rtattr_nested(tb_encap, 256, tb);
@@ -443,7 +443,7 @@ parse_encap_seg6local(struct rtattr *tb,
static int parse_encap_seg6(struct rtattr *tb, struct in6_addr *segs)
{
- struct rtattr *tb_encap[256] = {0};
+ struct rtattr *tb_encap[256] = {};
struct seg6_iptunnel_encap *ipt = NULL;
struct in6_addr *segments = NULL;
@@ -474,8 +474,8 @@ parse_nexthop_unicast(ns_id_t ns_id, struct rtmsg *rtm, struct rtattr **tb,
mpls_label_t labels[MPLS_MAX_LABELS] = {0};
int num_labels = 0;
enum seg6local_action_t seg6l_act = SEG6_LOCAL_ACTION_UNSPEC;
- struct seg6local_context seg6l_ctx = { {0} };
- struct in6_addr seg6_segs = { .s6_addr = {0} };
+ struct seg6local_context seg6l_ctx = {};
+ struct in6_addr seg6_segs = {};
int num_segs = 0;
vrf_id_t nh_vrf_id = vrf_id;
@@ -556,8 +556,8 @@ static uint8_t parse_multipath_nexthops_unicast(ns_id_t ns_id,
mpls_label_t labels[MPLS_MAX_LABELS] = {0};
int num_labels = 0;
enum seg6local_action_t seg6l_act = SEG6_LOCAL_ACTION_UNSPEC;
- struct seg6local_context seg6l_ctx = { {0} };
- struct in6_addr seg6_segs = { .s6_addr = {0} };
+ struct seg6local_context seg6l_ctx = {};
+ struct in6_addr seg6_segs = {};
int num_segs = 0;
struct rtattr *rtnh_tb[RTA_MAX + 1] = {};
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 235c06f177..4331487b8b 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -2701,10 +2701,9 @@ int zsend_srv6_manager_get_locator_chunk_response(struct zserv *client,
vrf_id_t vrf_id,
struct srv6_locator *loc)
{
- struct srv6_locator_chunk chunk;
+ struct srv6_locator_chunk chunk = {};
struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
- memset(&chunk, 0, sizeof(chunk));
strlcpy(chunk.locator_name, loc->name, sizeof(chunk.locator_name));
chunk.prefix = loc->prefix;
chunk.block_bits_length = loc->block_bits_length;