]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: Properly use memset() when zeroing
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 11 May 2022 10:16:44 +0000 (13:16 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 11 May 2022 11:08:47 +0000 (14:08 +0300)
    Wrong: memset(&a, 0, sizeof(struct ...));
    Good:  memset(&a, 0, sizeof(a));

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
82 files changed:
bgpd/bgp_aspath.c
bgpd/bgp_attr.c
bgpd/bgp_attr_evpn.c
bgpd/bgp_debug.c
bgpd/bgp_dump.c
bgpd/bgp_evpn.c
bgpd/bgp_evpn_mh.c
bgpd/bgp_evpn_vty.c
bgpd/bgp_flowspec.c
bgpd/bgp_flowspec_util.c
bgpd/bgp_keepalives.c
bgpd/bgp_label.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_nexthop.c
bgpd/bgp_packet.c
bgpd/bgp_pbr.c
bgpd/bgp_route.c
bgpd/bgp_snmp.c
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/rfapi/vnc_import_bgp.c
bgpd/rfp-example/librfp/rfp_example.c
eigrpd/eigrp_packet.c
eigrpd/eigrp_snmp.c
eigrpd/eigrpd.c
isisd/isis_bpf.c
isisd/isis_pfpacket.c
isisd/isisd.c
lib/keychain.c
lib/routemap.c
lib/sockunion.c
lib/table.c
lib/vty.c
nhrpd/vici.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_auth_trailer.c
ospf6d/ospf6_intra.c
ospf6d/ospf6_network.c
ospf6d/ospf6_route.c
ospf6d/ospf6_top.c
ospf6d/ospf6_zebra.c
ospfclient/ospf_apiclient.c
ospfd/ospf_apiserver.c
ospfd/ospf_asbr.c
ospfd/ospf_ext.c
ospfd/ospf_lsa.c
ospfd/ospf_lsdb.c
ospfd/ospf_packet.c
ospfd/ospf_ri.c
ospfd/ospf_snmp.c
ospfd/ospf_sr.c
ospfd/ospf_te.c
ospfd/ospf_zebra.c
ospfd/ospfd.c
pathd/path_pcep_cli.c
pceplib/pcep_pcc.c
pimd/pim_nht.c
pimd/pim_register.c
pimd/pim_sock.c
ripd/rip_interface.c
ripd/rip_nb_config.c
ripd/rip_snmp.c
ripd/ripd.c
ripngd/ripngd.c
vtysh/vtysh.c
watchfrr/watchfrr.c
zebra/connected.c
zebra/ioctl.c
zebra/kernel_socket.c
zebra/rt_netlink.c
zebra/rtadv.c
zebra/zapi_msg.c
zebra/zebra_evpn.c
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_neigh.c
zebra/zebra_fpm.c
zebra/zebra_mpls.c
zebra/zebra_mpls_vty.c
zebra/zebra_netns_notify.c
zebra/zebra_ptm.c
zebra/zebra_rib.c
zebra/zebra_vxlan.c

index 41166de05056f1cfd40a56fc13071af6bd3d4a49..39886337f39e1844e38bffdf1a1c24a0c2248399 100644 (file)
@@ -854,7 +854,7 @@ struct aspath *aspath_parse(struct stream *s, size_t length, int use32bit)
        if (length % AS16_VALUE_SIZE)
                return NULL;
 
-       memset(&as, 0, sizeof(struct aspath));
+       memset(&as, 0, sizeof(as));
        if (assegments_parse(s, length, &as.segments, use32bit) < 0)
                return NULL;
 
index f45362f81164e16409f725078429c081ce20f495..6c10469da8267ca05f311a3e5d2c27ae68be19c6 100644 (file)
@@ -980,7 +980,7 @@ struct attr *bgp_attr_aggregate_intern(
        struct attr *new;
        int ret;
 
-       memset(&attr, 0, sizeof(struct attr));
+       memset(&attr, 0, sizeof(attr));
 
        /* Origin attribute. */
        attr.origin = origin;
@@ -1043,7 +1043,7 @@ struct attr *bgp_attr_aggregate_intern(
                struct attr attr_tmp = attr;
                struct bgp_path_info rmap_path;
 
-               memset(&rmap_path, 0, sizeof(struct bgp_path_info));
+               memset(&rmap_path, 0, sizeof(rmap_path));
                rmap_path.peer = bgp->peer_self;
                rmap_path.attr = &attr_tmp;
 
index e528fadedd341140a917defc11474ba0afdc4a05..d379f40a88f1f58fea96a6417e1b9d930a3321d5 100644 (file)
@@ -49,7 +49,7 @@ void bgp_add_routermac_ecom(struct attr *attr, struct ethaddr *routermac)
        struct ecommunity_val routermac_ecom;
        struct ecommunity *ecomm = bgp_attr_get_ecommunity(attr);
 
-       memset(&routermac_ecom, 0, sizeof(struct ecommunity_val));
+       memset(&routermac_ecom, 0, sizeof(routermac_ecom));
        routermac_ecom.val[0] = ECOMMUNITY_ENCODE_EVPN;
        routermac_ecom.val[1] = ECOMMUNITY_EVPN_SUBTYPE_ROUTERMAC;
        memcpy(&routermac_ecom.val[2], routermac->octet, ETH_ALEN);
index 0993d6de576781e1025dd720fc80f9319587d556..ef71b191fa3deb546567b099705a81217d1d5f2e 100644 (file)
@@ -639,7 +639,7 @@ static int bgp_debug_parse_evpn_prefix(struct vty *vty, struct cmd_token **argv,
                return CMD_WARNING;
 
        if (evpn_type == BGP_EVPN_MAC_IP_ROUTE) {
-               memset(&ip, 0, sizeof(struct ipaddr));
+               memset(&ip, 0, sizeof(ip));
 
                argv_find(argv, argc, "mac", &mac_idx);
                (void)prefix_str2mac(argv[mac_idx + 1]->arg, &mac);
@@ -650,7 +650,7 @@ static int bgp_debug_parse_evpn_prefix(struct vty *vty, struct cmd_token **argv,
                build_evpn_type2_prefix((struct prefix_evpn *)argv_p,
                                        &mac, &ip);
        } else if (evpn_type == BGP_EVPN_IMET_ROUTE) {
-               memset(&ip, 0, sizeof(struct ipaddr));
+               memset(&ip, 0, sizeof(ip));
 
                argv_find(argv, argc, "ip", &ip_idx);
                str2ipaddr(argv[ip_idx + 1]->arg, &ip);
@@ -660,7 +660,7 @@ static int bgp_debug_parse_evpn_prefix(struct vty *vty, struct cmd_token **argv,
        } else if (evpn_type == BGP_EVPN_IP_PREFIX_ROUTE) {
                struct prefix ip_prefix;
 
-               memset(&ip_prefix, 0, sizeof(struct prefix));
+               memset(&ip_prefix, 0, sizeof(ip_prefix));
                if (argv_find(argv, argc, "ip", &ip_idx)) {
                        (void)str2prefix(argv[ip_idx + 1]->arg, &ip_prefix);
                        apply_mask(&ip_prefix);
index c389fec5f4ab43855316d5bf7edcad3c46837376..e57f449f781c7891be35d99afcec8b2413d8b316 100644 (file)
@@ -851,9 +851,9 @@ static int config_write_bgp_dump(struct vty *vty)
 /* Initialize BGP packet dump functionality. */
 void bgp_dump_init(void)
 {
-       memset(&bgp_dump_all, 0, sizeof(struct bgp_dump));
-       memset(&bgp_dump_updates, 0, sizeof(struct bgp_dump));
-       memset(&bgp_dump_routes, 0, sizeof(struct bgp_dump));
+       memset(&bgp_dump_all, 0, sizeof(bgp_dump_all));
+       memset(&bgp_dump_updates, 0, sizeof(bgp_dump_updates));
+       memset(&bgp_dump_routes, 0, sizeof(bgp_dump_routes));
 
        bgp_dump_obuf =
                stream_new((BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE * 2)
index ddb34258c492faa99e3f3381e30c4230920f0a49..74395bb0e2360138eef4801a2e5c6631d7f69669 100644 (file)
@@ -209,7 +209,7 @@ static struct vrf_irt_node *lookup_vrf_import_rt(struct ecommunity_val *rt)
                return NULL;
        }
 
-       memset(&tmp, 0, sizeof(struct vrf_irt_node));
+       memset(&tmp, 0, sizeof(tmp));
        memcpy(&tmp.rt, rt, ECOMMUNITY_SIZE);
        irt = hash_lookup(bgp_evpn->vrf_import_rt_hash, &tmp);
        return irt;
@@ -291,7 +291,7 @@ static struct irt_node *lookup_import_rt(struct bgp *bgp,
        struct irt_node *irt;
        struct irt_node tmp;
 
-       memset(&tmp, 0, sizeof(struct irt_node));
+       memset(&tmp, 0, sizeof(tmp));
        memcpy(&tmp.rt, rt, ECOMMUNITY_SIZE);
        irt = hash_lookup(bgp->import_rt_hash, &tmp);
        return irt;
@@ -1291,7 +1291,7 @@ static int update_evpn_type5_route(struct bgp *bgp_vrf, struct prefix_evpn *evp,
        if (src_attr)
                attr = *src_attr;
        else {
-               memset(&attr, 0, sizeof(struct attr));
+               memset(&attr, 0, sizeof(attr));
                bgp_attr_default_set(&attr, BGP_ORIGIN_IGP);
        }
 
@@ -1728,7 +1728,7 @@ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn,
        int route_change;
        bool old_is_sync = false;
 
-       memset(&attr, 0, sizeof(struct attr));
+       memset(&attr, 0, sizeof(attr));
 
        /* Build path-attribute for this route. */
        bgp_attr_default_set(&attr, BGP_ORIGIN_IGP);
@@ -3977,7 +3977,7 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
        pfx += 8;
 
        /* Make EVPN prefix. */
-       memset(&p, 0, sizeof(struct prefix_evpn));
+       memset(&p, 0, sizeof(p));
        p.family = AF_EVPN;
        p.prefixlen = EVPN_ROUTE_PREFIXLEN;
        p.prefix.route_type = BGP_EVPN_IMET_ROUTE;
@@ -4047,7 +4047,7 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
        pfx += 8;
 
        /* Make EVPN prefix. */
-       memset(&p, 0, sizeof(struct prefix_evpn));
+       memset(&p, 0, sizeof(p));
        p.family = AF_EVPN;
        p.prefixlen = EVPN_ROUTE_PREFIXLEN;
        p.prefix.route_type = BGP_EVPN_IP_PREFIX_ROUTE;
@@ -4427,7 +4427,7 @@ void bgp_evpn_install_uninstall_default_route(struct bgp *bgp_vrf, afi_t afi,
        struct prefix ip_prefix;
 
        /* form the default prefix 0.0.0.0/0 */
-       memset(&ip_prefix, 0, sizeof(struct prefix));
+       memset(&ip_prefix, 0, sizeof(ip_prefix));
        ip_prefix.family = afi2family(afi);
 
        if (add) {
@@ -4990,7 +4990,7 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
 
        for (; pnt < lim; pnt += psize) {
                /* Clear prefix structure. */
-               memset(&p, 0, sizeof(struct prefix));
+               memset(&p, 0, sizeof(p));
 
                /* Deal with path-id if AddPath is supported. */
                if (addpath_capable) {
@@ -5274,7 +5274,7 @@ struct bgpevpn *bgp_evpn_lookup_vni(struct bgp *bgp, vni_t vni)
        struct bgpevpn *vpn;
        struct bgpevpn tmp;
 
-       memset(&tmp, 0, sizeof(struct bgpevpn));
+       memset(&tmp, 0, sizeof(tmp));
        tmp.vni = vni;
        vpn = hash_lookup(bgp->vnihash, &tmp);
        return vpn;
@@ -6306,7 +6306,7 @@ static struct bgpevpn *bgp_evpn_vni_svi_hash_lookup(struct bgp *bgp,
        struct bgpevpn *vpn;
        struct bgpevpn tmp;
 
-       memset(&tmp, 0, sizeof(struct bgpevpn));
+       memset(&tmp, 0, sizeof(tmp));
        tmp.svi_ifindex = svi;
        vpn = hash_lookup(bgp->vni_svi_hash, &tmp);
        return vpn;
@@ -6376,7 +6376,7 @@ bool bgp_evpn_is_gateway_ip_resolved(struct bgp_nexthop_cache *bnc)
         * which stores all the remote IP addresses received via MAC/IP routes
         * in this EVI
         */
-       memset(&tmp, 0, sizeof(struct evpn_remote_ip));
+       memset(&tmp, 0, sizeof(tmp));
 
        p = &bnc->prefix;
        if (p->family == AF_INET) {
@@ -6409,7 +6409,7 @@ static void bgp_evpn_remote_ip_process_nexthops(struct bgpevpn *vpn,
        if (!vpn->bgp_vrf || vpn->svi_ifindex == 0)
                return;
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
 
        if (addr->ipa_type == IPADDR_V4) {
                afi = AFI_IP;
index 6ce97d22c4e4e407c45e3fed114673edcca3e6b7..a1c32403b364d3acb5c9fef7cff33d7611c7b9af 100644 (file)
@@ -599,7 +599,7 @@ static void bgp_evpn_type4_route_extcomm_build(struct bgp_evpn_es *es,
        bgp_attr_set_ecommunity(attr, ecommunity_dup(&ecom_encap));
 
        /* ES import RT */
-       memset(&mac, 0, sizeof(struct ethaddr));
+       memset(&mac, 0, sizeof(mac));
        memset(&ecom_es_rt, 0, sizeof(ecom_es_rt));
        es_get_system_mac(&es->esi, &mac);
        encode_es_rt_extcomm(&eval_es_rt, &mac);
@@ -633,7 +633,7 @@ static int bgp_evpn_type4_route_update(struct bgp *bgp,
        struct bgp_dest *dest = NULL;
        struct bgp_path_info *pi = NULL;
 
-       memset(&attr, 0, sizeof(struct attr));
+       memset(&attr, 0, sizeof(attr));
 
        /* Build path-attribute for this route. */
        bgp_attr_default_set(&attr, BGP_ORIGIN_IGP);
@@ -943,7 +943,7 @@ static int bgp_evpn_type1_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
        int route_changed = 0;
        struct prefix_rd *global_rd;
 
-       memset(&attr, 0, sizeof(struct attr));
+       memset(&attr, 0, sizeof(attr));
 
        /* Build path-attribute for this route. */
        bgp_attr_default_set(&attr, BGP_ORIGIN_IGP);
@@ -4507,7 +4507,7 @@ static struct bgp_evpn_nh *bgp_evpn_nh_add(struct bgp *bgp_vrf,
        struct bgp_evpn_nh tmp_n;
        struct bgp_evpn_nh *n = NULL;
 
-       memset(&tmp_n, 0, sizeof(struct bgp_evpn_nh));
+       memset(&tmp_n, 0, sizeof(tmp_n));
        memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr));
        n = hash_get(bgp_vrf->evpn_nh_table, &tmp_n, bgp_evpn_nh_alloc);
        ipaddr2str(ip, n->nh_str, sizeof(n->nh_str));
index 0c9cd3b7218de1e4e4e0025ca7868b82dd476a2d..3d59c9df793e05850505ef85de9e39eadb155cc4 100644 (file)
@@ -2367,7 +2367,7 @@ static void evpn_show_routes_vni_all(struct vty *vty, struct bgp *bgp,
        num_vnis = hashcount(bgp->vnihash);
        if (!num_vnis)
                return;
-       memset(&wctx, 0, sizeof(struct vni_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.bgp = bgp;
        wctx.vty = vty;
        wctx.vtep_ip = vtep_ip;
index de3f2a9d4702a650973128fe822227e0d3900568..39c0cfe5147ba528e40c4f9c78f092fc0a0a89ba 100644 (file)
@@ -121,7 +121,7 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
 
        for (; pnt < lim; pnt += psize) {
                /* Clear prefix structure. */
-               memset(&p, 0, sizeof(struct prefix));
+               memset(&p, 0, sizeof(p));
 
                /* All FlowSpec NLRI begin with length. */
                if (pnt + 1 > lim)
index 348dc7c9d1428c8d7ab11217cd47796e204a25fd..9f3ea499ff2018b96fb034e256e699fe87f1a1ee 100644 (file)
@@ -97,7 +97,7 @@ bool bgp_flowspec_contains_prefix(const struct prefix *pfs,
                switch (type) {
                case FLOWSPEC_DEST_PREFIX:
                case FLOWSPEC_SRC_PREFIX:
-                       memset(&compare, 0, sizeof(struct prefix));
+                       memset(&compare, 0, sizeof(compare));
                        ret = bgp_flowspec_ip_address(
                                        BGP_FLOWSPEC_CONVERT_TO_NON_OPAQUE,
                                        nlri_content+offset,
@@ -185,7 +185,7 @@ int bgp_flowspec_ip_address(enum bgp_flowspec_util_nlri_t type,
        uint8_t prefix_offset = 0;
 
        *error = 0;
-       memset(&prefix_local, 0, sizeof(struct prefix));
+       memset(&prefix_local, 0, sizeof(prefix_local));
        /* read the prefix length */
        prefix_local.prefixlen = nlri_ptr[offset];
        psize = PSIZE(prefix_local.prefixlen);
@@ -665,7 +665,7 @@ bool bgp_flowspec_get_first_nh(struct bgp *bgp, struct bgp_path_info *pi,
        struct bgp_dest *dest = pi->net;
        struct bgp_pbr_entry_action *api_action;
 
-       memset(&api, 0, sizeof(struct bgp_pbr_entry_main));
+       memset(&api, 0, sizeof(api));
        if (bgp_pbr_build_and_validate_entry(bgp_dest_get_prefix(dest), pi,
                                             &api)
            < 0)
index 4cb7bd788a0a6d15e3006c533f43fb15b3517039..86202a0e3dc5f6f0f0287eade66157aaab2497ef 100644 (file)
@@ -121,7 +121,7 @@ static void peer_process(struct hash_bucket *hb, void *arg)
 
                bgp_keepalive_send(pkat->peer);
                monotime(&pkat->last);
-               memset(&elapsed, 0x00, sizeof(struct timeval));
+               memset(&elapsed, 0, sizeof(elapsed));
                diff = ka;
        }
 
@@ -220,7 +220,7 @@ void *bgp_keepalives_start(void *arg)
 
                hash_iterate(peerhash, peer_process, &next_update);
                if (next_update.tv_sec == -1)
-                       memset(&next_update, 0x00, sizeof(next_update));
+                       memset(&next_update, 0, sizeof(next_update));
 
                monotime_since(&currtime, &aftertime);
 
index f53deb63b3c066903e285d2ad6eb450cc1c7981c..a9c4b4c6783b79e0c6d9d79d2b076e1a3a9db3b5 100644 (file)
@@ -55,7 +55,7 @@ int bgp_parse_fec_update(void)
 
        s = zclient->ibuf;
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
        p.family = stream_getw(s);
        p.prefixlen = stream_getc(s);
        stream_get(p.u.val, s, PSIZE(p.prefixlen));
@@ -350,7 +350,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
 
        for (; pnt < lim; pnt += psize) {
                /* Clear prefix structure. */
-               memset(&p, 0, sizeof(struct prefix));
+               memset(&p, 0, sizeof(p));
 
                if (addpath_capable) {
 
index 4d8c4ac2ac334d83dfe757ccf73f995e3c99f88f..d1a6daa8f506239d1262ebe815c30488a5432845 100644 (file)
@@ -131,7 +131,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
 #define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
        while (STREAM_READABLE(data) > 0) {
                /* Clear prefix structure. */
-               memset(&p, 0, sizeof(struct prefix));
+               memset(&p, 0, sizeof(p));
 
                if (addpath_capable) {
                        STREAM_GET(&addpath_id, data, BGP_ADDPATH_ID_LEN);
index de48c975130f026afa0192f13b92f3a1fea9af55..c6043807dd9196f99718610ffc08fe15f4900bd1 100644 (file)
@@ -560,7 +560,7 @@ bool bgp_nexthop_self(struct bgp *bgp, afi_t afi, uint8_t type,
                return true;
 
        if (new_afi == AF_INET && hashcount(bgp->tip_hash)) {
-               memset(&tmp_tip, 0, sizeof(struct tip_addr));
+               memset(&tmp_tip, 0, sizeof(tmp_tip));
                tmp_tip.addr = attr->nexthop;
 
                if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP)) {
index 9a1216a031dbd141629ed5537868882d3d848db1..459b4d5e3f951d50a9127e84402dae7c9c507ec6 100644 (file)
@@ -1710,7 +1710,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
        }
 
        /* Set initial values. */
-       memset(&attr, 0, sizeof(struct attr));
+       memset(&attr, 0, sizeof(attr));
        attr.label_index = BGP_INVALID_LABEL_INDEX;
        attr.label = MPLS_INVALID_LABEL;
        memset(&nlris, 0, sizeof(nlris));
@@ -2249,8 +2249,7 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
                                         * to maximise debug information.
                                         */
                                        int ok;
-                                       memset(&orfp, 0,
-                                              sizeof(struct orf_prefix));
+                                       memset(&orfp, 0, sizeof(orfp));
                                        common = *p_pnt++;
                                        /* after ++: p_pnt <= p_end */
                                        if (common
index 352670e6c1fedac72a6af7f3f6c07ab3a437048f..7b5e28724209573662a4ff020bbf871a156eb25c 100644 (file)
@@ -2679,9 +2679,9 @@ static void bgp_pbr_handle_entry(struct bgp *bgp, struct bgp_path_info *path,
        struct bgp_pbr_val_mask bpvm;
 
        memset(&range, 0, sizeof(range));
-       memset(&nh, 0, sizeof(struct nexthop));
-       memset(&bpf, 0, sizeof(struct bgp_pbr_filter));
-       memset(&bpof, 0, sizeof(struct bgp_pbr_or_filter));
+       memset(&nh, 0, sizeof(nh));
+       memset(&bpf, 0, sizeof(bpf));
+       memset(&bpof, 0, sizeof(bpof));
        if (api->match_bitmask & PREFIX_SRC_PRESENT ||
            (api->type == BGP_PBR_IPRULE &&
             api->match_bitmask_iprule & PREFIX_SRC_PRESENT))
@@ -2692,7 +2692,7 @@ static void bgp_pbr_handle_entry(struct bgp *bgp, struct bgp_path_info *path,
                dst = &api->dst_prefix;
        if (api->type == BGP_PBR_IPRULE)
                bpf.type = api->type;
-       memset(&nh, 0, sizeof(struct nexthop));
+       memset(&nh, 0, sizeof(nh));
        nh.vrf_id = VRF_UNKNOWN;
        if (api->match_protocol_num) {
                proto = (uint8_t)api->protocol[0].value;
index 2544ea520872d9410a332051be50396735dc0d53..500e2f45ef229da7ae4e8e50945a2112f5799af8 100644 (file)
@@ -1597,7 +1597,7 @@ static int bgp_input_modifier(struct peer *peer, const struct prefix *p,
 
        /* Route map apply. */
        if (rmap) {
-               memset(&rmap_path, 0, sizeof(struct bgp_path_info));
+               memset(&rmap_path, 0, sizeof(rmap_path));
                /* Duplicate current value to new structure for modification. */
                rmap_path.peer = peer;
                rmap_path.attr = attr;
@@ -1653,7 +1653,7 @@ static int bgp_output_modifier(struct peer *peer, const struct prefix *p,
        if (rmap == NULL)
                return RMAP_DENY;
 
-       memset(&rmap_path, 0, sizeof(struct bgp_path_info));
+       memset(&rmap_path, 0, sizeof(rmap_path));
        /* Route map apply. */
        /* Duplicate current value to new structure for modification. */
        rmap_path.peer = peer;
@@ -2698,7 +2698,7 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp,
                                   PEER_STATUS_ORF_WAIT_REFRESH))
                return;
 
-       memset(&attr, 0, sizeof(struct attr));
+       memset(&attr, 0, sizeof(attr));
        /* It's initialized in bgp_announce_check() */
 
        /* Announcement to the subgroup. If the route is filtered withdraw it.
@@ -3758,7 +3758,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
        if (orig_safi == SAFI_LABELED_UNICAST)
                safi = SAFI_UNICAST;
 
-       memset(&new_attr, 0, sizeof(struct attr));
+       memset(&new_attr, 0, sizeof(new_attr));
        new_attr.label_index = BGP_INVALID_LABEL_INDEX;
        new_attr.label = MPLS_INVALID_LABEL;
 
@@ -5656,7 +5656,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
           then the Error Subcode is set to Invalid Network Field. */
        for (; pnt < lim; pnt += psize) {
                /* Clear prefix structure. */
-               memset(&p, 0, sizeof(struct prefix));
+               memset(&p, 0, sizeof(p));
 
                if (addpath_capable) {
 
@@ -5833,7 +5833,7 @@ void bgp_static_update(struct bgp *bgp, const struct prefix *p,
        if (bgp_static->rmap.name) {
                struct attr attr_tmp = attr;
 
-               memset(&rmap_path, 0, sizeof(struct bgp_path_info));
+               memset(&rmap_path, 0, sizeof(rmap_path));
                rmap_path.peer = bgp->peer_self;
                rmap_path.attr = &attr_tmp;
 
@@ -6145,7 +6145,7 @@ static void bgp_static_update_safi(struct bgp *bgp, const struct prefix *p,
                memcpy(&attr.esi, bgp_static->eth_s_id, sizeof(esi_t));
                if (bgp_static->encap_tunneltype == BGP_ENCAP_TYPE_VXLAN) {
                        struct bgp_encap_type_vxlan bet;
-                       memset(&bet, 0, sizeof(struct bgp_encap_type_vxlan));
+                       memset(&bet, 0, sizeof(bet));
                        bet.vnid = p->u.prefix_evpn.prefix_addr.eth_tag;
                        bgp_encap_type_vxlan_to_tlv(&bet, &attr);
                }
@@ -6645,7 +6645,7 @@ int bgp_static_set_safi(afi_t afi, safi_t safi, struct vty *vty,
                        return CMD_WARNING_CONFIG_FAILED;
                }
                if (gwip) {
-                       memset(&gw_ip, 0, sizeof(struct prefix));
+                       memset(&gw_ip, 0, sizeof(gw_ip));
                        ret = str2prefix(gwip, &gw_ip);
                        if (!ret) {
                                vty_out(vty, "%% Malformed GatewayIp\n");
@@ -8372,7 +8372,7 @@ void bgp_redistribute_add(struct bgp *bgp, struct prefix *p,
 
                /* Apply route-map. */
                if (red->rmap.name) {
-                       memset(&rmap_path, 0, sizeof(struct bgp_path_info));
+                       memset(&rmap_path, 0, sizeof(rmap_path));
                        rmap_path.peer = bgp->peer_self;
                        rmap_path.attr = &attr_new;
 
index 868801c14e1857d7c012e514a3488aa520cace71..e25d8d90db6e39b711571c19d0acbb3b1e37a085 100644 (file)
@@ -461,7 +461,7 @@ static int write_bgpPeerTable(int action, uint8_t *var_val,
 
        intval = *(long *)var_val;
 
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        peer = bgpPeerTable_lookup(NULL, name, &length, &addr, 1);
        if (!peer)
@@ -518,7 +518,7 @@ static uint8_t *bgpPeerTable(struct variable *v, oid name[], size_t *length,
        if (smux_header_table(v, name, length, exact, var_len, write_method)
            == MATCH_FAILED)
                return NULL;
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        peer = bgpPeerTable_lookup(v, name, length, &addr, exact);
        if (!peer)
@@ -802,7 +802,7 @@ static uint8_t *bgp4PathAttrTable(struct variable *v, oid name[],
        if (smux_header_table(v, name, length, exact, var_len, write_method)
            == MATCH_FAILED)
                return NULL;
-       memset(&addr, 0, sizeof(struct prefix_ipv4));
+       memset(&addr, 0, sizeof(addr));
 
        path = bgp4PathAttrLookup(v, name, length, bgp, &addr, exact);
        if (!path)
index 77b8a8ab969628d61addd3d8f55c54de9ac2c381..2c1d561721956c5f4942be8728e147b2b23b03f1 100644 (file)
@@ -2890,8 +2890,8 @@ static int bgp_zebra_process_local_l3vni(ZAPI_CALLBACK_ARGS)
        ifindex_t svi_ifindex;
        bool is_anycast_mac = false;
 
-       memset(&svi_rmac, 0, sizeof(struct ethaddr));
-       memset(&originator_ip, 0, sizeof(struct in_addr));
+       memset(&svi_rmac, 0, sizeof(svi_rmac));
+       memset(&originator_ip, 0, sizeof(originator_ip));
        s = zclient->ibuf;
        l3vni = stream_getl(s);
        if (cmd == ZEBRA_L3VNI_ADD) {
@@ -3048,7 +3048,7 @@ static int bgp_zebra_process_local_ip_prefix(ZAPI_CALLBACK_ARGS)
        struct bgp *bgp_vrf = NULL;
        struct prefix p;
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
        s = zclient->ibuf;
        stream_get(&p, s, sizeof(struct prefix));
 
@@ -3519,7 +3519,7 @@ void bgp_zebra_announce_default(struct bgp *bgp, struct nexthop *nh,
        if (!vrf_is_backend_netns() && bgp->vrf_id != nh->vrf_id)
                return;
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
        if (afi != AFI_IP && afi != AFI_IP6)
                return;
        p.family = afi2family(afi);
@@ -3620,7 +3620,7 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
        /* Check if capability is already sent. If the flag force is set
         * send the capability since this can be initial bgp configuration
         */
-       memset(&api, 0, sizeof(struct zapi_cap));
+       memset(&api, 0, sizeof(api));
        if (disable) {
                api.cap = ZEBRA_CLIENT_GR_DISABLE;
                api.vrf_id = bgp->vrf_id;
@@ -3700,7 +3700,7 @@ int bgp_zebra_stale_timer_update(struct bgp *bgp)
                return BGP_GR_FAILURE;
        }
 
-       memset(&api, 0, sizeof(struct zapi_cap));
+       memset(&api, 0, sizeof(api));
        api.cap = ZEBRA_CLIENT_RIB_STALE_TIME;
        api.stale_removal_time = bgp->rib_stale_time;
        api.vrf_id = bgp->vrf_id;
index 33ed7d1d94e92e130ed2262e0ab5299a2e76982e..48ee84cd32816a75793c2cfd1a109c0c768cbc9c 100644 (file)
@@ -7820,7 +7820,7 @@ void bgp_master_init(struct thread_master *master, const int buffer_size,
 {
        qobj_init();
 
-       memset(&bgp_master, 0, sizeof(struct bgp_master));
+       memset(&bgp_master, 0, sizeof(bgp_master));
 
        bm = &bgp_master;
        bm->bgp = list_new();
index 994de7d7298c99d8e5ae4eb7d035eeb799e36962..acbc413917e55492de701d413d985b293341c7b7 100644 (file)
@@ -238,7 +238,7 @@ static void vnc_rhnck(char *tag)
                struct prefix pfx_orig_nexthop;
 
                memset(&pfx_orig_nexthop, 0,
-                      sizeof(struct prefix)); /* keep valgrind happy */
+                      sizeof(pfx_orig_nexthop)); /* keep valgrind happy */
 
                pkey = p->key;
                pb = p->value;
@@ -303,7 +303,7 @@ static int process_unicast_route(struct bgp *bgp,            /* in */
        struct prefix pfx_orig_nexthop;
 
        memset(&pfx_orig_nexthop, 0,
-              sizeof(struct prefix)); /* keep valgrind happy */
+              sizeof(pfx_orig_nexthop)); /* keep valgrind happy */
 
        /*
         * prefix list check
@@ -346,7 +346,7 @@ static int process_unicast_route(struct bgp *bgp,            /* in */
         * must be freed before we return. It's easier to put it after
         * all of the possible returns above.
         */
-       memset(&hattr, 0, sizeof(struct attr));
+       memset(&hattr, 0, sizeof(hattr));
        /* hattr becomes a ghost attr */
        hattr = *attr;
 
@@ -773,7 +773,7 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp,
         * must be freed before we return. It's easier to put it after
         * all of the possible returns above.
         */
-       memset(&hattr, 0, sizeof(struct attr));
+       memset(&hattr, 0, sizeof(hattr));
        /* hattr becomes a ghost attr */
        hattr = *attr;
 
@@ -966,7 +966,7 @@ static void vnc_import_bgp_add_route_mode_nvegroup(
         * must be freed before we return. It's easier to put it after
         * all of the possible returns above.
         */
-       memset(&hattr, 0, sizeof(struct attr));
+       memset(&hattr, 0, sizeof(hattr));
        /* hattr becomes a ghost attr */
        hattr = *attr;
 
@@ -1420,7 +1420,7 @@ void vnc_import_bgp_add_vnc_host_route_mode_resolve_nve(
                uint32_t local_pref;
 
                memset(&pfx_unicast_nexthop, 0,
-                      sizeof(struct prefix)); /* keep valgrind happy */
+                      sizeof(pfx_unicast_nexthop)); /* keep valgrind happy */
 
                if (VNC_DEBUG(IMPORT_BGP_ADD_ROUTE))
                        vnc_zlog_debug_any(
@@ -1538,7 +1538,7 @@ void vnc_import_bgp_del_vnc_host_route_mode_resolve_nve(
                struct prefix pfx_unicast_nexthop;
 
                memset(&pfx_unicast_nexthop, 0,
-                      sizeof(struct prefix)); /* keep valgrind happy */
+                      sizeof(pfx_unicast_nexthop)); /* keep valgrind happy */
 
                if (process_unicast_route(bgp, afi, &pb->upfx, pb->ubpi, &ecom,
                                          &pfx_unicast_nexthop)) {
@@ -1713,7 +1713,7 @@ static void vnc_import_bgp_exterior_add_route_it(
                                        prd = NULL;
 
                                /* use local_pref from unicast route */
-                               memset(&new_attr, 0, sizeof(struct attr));
+                               memset(&new_attr, 0, sizeof(new_attr));
                                new_attr = *bpi_interior->attr;
                                if (info->attr->flag
                                    & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF)) {
@@ -1807,7 +1807,7 @@ void vnc_import_bgp_exterior_del_route(
                return;
 
        memset(&pfx_orig_nexthop, 0,
-              sizeof(struct prefix)); /* keep valgrind happy */
+              sizeof(pfx_orig_nexthop)); /* keep valgrind happy */
 
        h = bgp_default->rfapi;
        hc = bgp_default->rfapi_cfg;
@@ -2473,7 +2473,7 @@ void vnc_import_bgp_exterior_del_route_interior(
                                        prd = NULL;
 
                                /* use local_pref from unicast route */
-                               memset(&new_attr, 0, sizeof(struct attr));
+                               memset(&new_attr, 0, sizeof(new_attr));
                                new_attr = *bpi->attr;
                                if (bpi_exterior
                                    && (bpi_exterior->attr->flag
index 060fc765509626bc7e7f6b9813847d4371eeacb8..9a4ec7dbf38c4524b63f71df7a7efd20503d6b15 100644 (file)
@@ -287,7 +287,7 @@ static int rfp_cfg_write_cb(struct vty *vty, void *rfp_start_val)
 void *rfp_start(struct thread_master *master, struct rfapi_rfp_cfg **cfgp,
                struct rfapi_rfp_cb_methods **cbmp)
 {
-       memset(&global_rfi, 0, sizeof(struct rfp_instance_t));
+       memset(&global_rfi, 0, sizeof(global_rfi));
        global_rfi.master = master; /* for BGPD threads */
 
        /* initilize struct rfapi_rfp_cfg, see rfapi.h */
index 491b2994b016e635408a08b1ee0079f8197243d6..dd5ba8a1641ebcdd58cdddc130d1c8311737f084 100644 (file)
@@ -370,7 +370,7 @@ void eigrp_write(struct thread *thread)
        if (ep->dst.s_addr == htonl(EIGRP_MULTICAST_ADDRESS))
                eigrp_if_ipmulticast(eigrp, &ei->address, ei->ifp->ifindex);
 
-       memset(&iph, 0, sizeof(struct ip));
+       memset(&iph, 0, sizeof(iph));
        memset(&sa_dst, 0, sizeof(sa_dst));
 
        /*
@@ -713,7 +713,7 @@ static struct stream *eigrp_recv_packet(struct eigrp *eigrp,
        char buff[CMSG_SPACE(SOPT_SIZE_CMSG_IFINDEX_IPV4())];
        struct msghdr msgh;
 
-       memset(&msgh, 0, sizeof(struct msghdr));
+       memset(&msgh, 0, sizeof(msgh));
        msgh.msg_iov = &iov;
        msgh.msg_iovlen = 1;
        msgh.msg_control = (caddr_t)buff;
index 9ada292feb84f5ca540e3f8d7bdaa05e50649094..5a930424c004785eb76020513f6dee9e272e7b76 100644 (file)
@@ -1034,7 +1034,7 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&nbr_addr, 0, sizeof(struct in_addr));
+       memset(&nbr_addr, 0, sizeof(nbr_addr));
        ifindex = 0;
 
        nbr = eigrpNbrLookup(v, name, length, &nbr_addr, &ifindex, exact);
index 84d4f6aeeb01eb8bf5a8a191864cd7e04fb8e0f0..7bc7be97061d2a36e0f5423ceed8010f4f309694 100644 (file)
@@ -123,7 +123,7 @@ void eigrp_master_init(void)
 {
        struct timeval tv;
 
-       memset(&eigrp_master, 0, sizeof(struct eigrp_master));
+       memset(&eigrp_master, 0, sizeof(eigrp_master));
 
        eigrp_om = &eigrp_master;
        eigrp_om->eigrp = list_new();
index 88c3bfa63c40d4bb6c9cf21eb4f21e139a71359c..5f3d70ed3a02b98ae75bf0b0196cc542beceb8b3 100644 (file)
@@ -161,7 +161,7 @@ static int open_bpf_dev(struct isis_circuit *circuit)
        /*
         * And set the filter
         */
-       memset(&bpf_prog, 0, sizeof(struct bpf_program));
+       memset(&bpf_prog, 0, sizeof(bpf_prog));
        bpf_prog.bf_len = 8;
        bpf_prog.bf_insns = &(llcfilter[0]);
        if (ioctl(fd, BIOCSETF, (caddr_t)&bpf_prog) < 0) {
index d58cd1c5bc58f33e8fbb355f5b860f078f339170..a448e0043c58d603468b7578292f38acd2c5223b 100644 (file)
@@ -144,7 +144,7 @@ static int open_packet_socket(struct isis_circuit *circuit)
        /*
         * Bind to the physical interface
         */
-       memset(&s_addr, 0, sizeof(struct sockaddr_ll));
+       memset(&s_addr, 0, sizeof(s_addr));
        s_addr.sll_family = AF_PACKET;
        s_addr.sll_protocol = htons(ETH_P_ALL);
        s_addr.sll_ifindex = circuit->interface->ifindex;
@@ -233,7 +233,7 @@ int isis_recv_pdu_bcast(struct isis_circuit *circuit, uint8_t *ssnpa)
 
        addr_len = sizeof(s_addr);
 
-       memset(&s_addr, 0, sizeof(struct sockaddr_ll));
+       memset(&s_addr, 0, sizeof(s_addr));
 
        bytesread =
                recvfrom(circuit->fd, (void *)&llc, LLC_LEN, MSG_PEEK,
@@ -306,7 +306,7 @@ int isis_recv_pdu_p2p(struct isis_circuit *circuit, uint8_t *ssnpa)
        int bytesread, addr_len;
        struct sockaddr_ll s_addr;
 
-       memset(&s_addr, 0, sizeof(struct sockaddr_ll));
+       memset(&s_addr, 0, sizeof(s_addr));
        addr_len = sizeof(s_addr);
 
        /* we can read directly to the stream */
@@ -351,7 +351,7 @@ int isis_send_pdu_bcast(struct isis_circuit *circuit, int level)
        struct sockaddr_ll sa;
 
        stream_set_getp(circuit->snd_stream, 0);
-       memset(&sa, 0, sizeof(struct sockaddr_ll));
+       memset(&sa, 0, sizeof(sa));
        sa.sll_family = AF_PACKET;
 
        size_t frame_size = stream_get_endp(circuit->snd_stream) + LLC_LEN;
@@ -398,7 +398,7 @@ int isis_send_pdu_p2p(struct isis_circuit *circuit, int level)
        ssize_t rv;
 
        stream_set_getp(circuit->snd_stream, 0);
-       memset(&sa, 0, sizeof(struct sockaddr_ll));
+       memset(&sa, 0, sizeof(sa));
        sa.sll_family = AF_PACKET;
        sa.sll_ifindex = circuit->interface->ifindex;
        sa.sll_halen = ETH_ALEN;
index 85307f448b4277fa9e8028504e2554ca727a4581..996a62f4d55acbee8dfb72cf845a23ea11f90f61 100644 (file)
@@ -177,7 +177,7 @@ struct isis *isis_lookup_by_sysid(const uint8_t *sysid)
 
 void isis_master_init(struct thread_master *master)
 {
-       memset(&isis_master, 0, sizeof(struct isis_master));
+       memset(&isis_master, 0, sizeof(isis_master));
        im = &isis_master;
        im->isis = list_new();
        im->master = master;
index c29c45a11419e007a6a6af09c4f22ddc8320f68a..5dcb572a3c4ae35dd4de21e8f72659714ec2bff8 100644 (file)
@@ -542,7 +542,7 @@ static time_t key_str2time(const char *time_str, const char *day_str,
        /* Check year_str.  Year must be <1993-2035>. */
        GET_LONG_RANGE(year, year_str, 1993, 2035);
 
-       memset(&tm, 0, sizeof(struct tm));
+       memset(&tm, 0, sizeof(tm));
        tm.tm_sec = sec;
        tm.tm_min = min;
        tm.tm_hour = hour;
index 46161fd8172122add369f9bd1dcb71967d678c70..722693ea27453fe6617a1bec27087bc6ee46e3f3 100644 (file)
@@ -759,7 +759,7 @@ struct route_map *route_map_lookup_by_name(const char *name)
                return NULL;
 
        // map.deleted is false via memset
-       memset(&tmp_map, 0, sizeof(struct route_map));
+       memset(&tmp_map, 0, sizeof(tmp_map));
        tmp_map.name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, name);
        map = hash_lookup(route_map_master_hash, &tmp_map);
        XFREE(MTYPE_ROUTE_MAP_NAME, tmp_map.name);
@@ -797,7 +797,7 @@ int route_map_mark_updated(const char *name)
         * with deleted=true
         */
        if (!map) {
-               memset(&tmp_map, 0, sizeof(struct route_map));
+               memset(&tmp_map, 0, sizeof(tmp_map));
                tmp_map.name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, name);
                tmp_map.deleted = true;
                map = hash_lookup(route_map_master_hash, &tmp_map);
@@ -2481,7 +2481,7 @@ void route_map_notify_pentry_dependencies(const char *affected_name,
                if (!dep->this_hash)
                        dep->this_hash = upd8_hash;
 
-               memset(&pentry_dep, 0, sizeof(struct route_map_pentry_dep));
+               memset(&pentry_dep, 0, sizeof(pentry_dep));
                pentry_dep.pentry = pentry;
                pentry_dep.plist_name = affected_name;
                pentry_dep.event = event;
@@ -2760,7 +2760,7 @@ static void route_map_clear_reference(struct hash_bucket *bucket, void *arg)
        struct route_map_dep *dep = bucket->data;
        struct route_map_dep_data *dep_data = NULL, tmp_dep_data;
 
-       memset(&tmp_dep_data, 0, sizeof(struct route_map_dep_data));
+       memset(&tmp_dep_data, 0, sizeof(tmp_dep_data));
        tmp_dep_data.rname = arg;
        dep_data = hash_release(dep->dep_rmap_hash, &tmp_dep_data);
        if (dep_data) {
@@ -2873,7 +2873,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
                if (!dep->this_hash)
                        dep->this_hash = dephash;
 
-               memset(&tmp_dep_data, 0, sizeof(struct route_map_dep_data));
+               memset(&tmp_dep_data, 0, sizeof(tmp_dep_data));
                tmp_dep_data.rname = rname;
                dep_data = hash_lookup(dep->dep_rmap_hash, &tmp_dep_data);
                if (!dep_data)
@@ -2897,7 +2897,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
                        goto out;
                }
 
-               memset(&tmp_dep_data, 0, sizeof(struct route_map_dep_data));
+               memset(&tmp_dep_data, 0, sizeof(tmp_dep_data));
                tmp_dep_data.rname = rname;
                dep_data = hash_lookup(dep->dep_rmap_hash, &tmp_dep_data);
                /*
index 9763b38e28a42518b596cbac867dcbc6a82d025a..97b198c0189e34ebbbbe08020169b73d07803abe 100644 (file)
@@ -107,7 +107,7 @@ static void sockunion_normalise_mapped(union sockunion *su)
 
        if (su->sa.sa_family == AF_INET6
            && IN6_IS_ADDR_V4MAPPED(&su->sin6.sin6_addr)) {
-               memset(&sin, 0, sizeof(struct sockaddr_in));
+               memset(&sin, 0, sizeof(sin));
                sin.sin_family = AF_INET;
                sin.sin_port = su->sin6.sin6_port;
                memcpy(&sin.sin_addr, ((char *)&su->sin6.sin6_addr) + 12, 4);
index 523183bef228e0b619c654449d79d1d9925d8dc4..6c4c6c7d3689d76a45f0f843b5a0eb0d1c8099c2 100644 (file)
@@ -228,7 +228,7 @@ struct route_node *route_node_match_ipv4(struct route_table *table,
 {
        struct prefix_ipv4 p;
 
-       memset(&p, 0, sizeof(struct prefix_ipv4));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET;
        p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = *addr;
@@ -241,7 +241,7 @@ struct route_node *route_node_match_ipv6(struct route_table *table,
 {
        struct prefix_ipv6 p;
 
-       memset(&p, 0, sizeof(struct prefix_ipv6));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET6;
        p.prefixlen = IPV6_MAX_BITLEN;
        p.prefix = *addr;
index 619d51e1ce7dcb8fcc1ccbdd220fa404b04876fc..e0e2f39229d19bdbcde5c32821ba76ebfaaea40c 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1827,7 +1827,7 @@ static void vty_serv_sock_addrinfo(const char *hostname, unsigned short port)
        int sock;
        char port_str[BUFSIZ];
 
-       memset(&req, 0, sizeof(struct addrinfo));
+       memset(&req, 0, sizeof(req));
        req.ai_flags = AI_PASSIVE;
        req.ai_family = AF_UNSPEC;
        req.ai_socktype = SOCK_STREAM;
@@ -1912,7 +1912,7 @@ static void vty_serv_un(const char *path)
        }
 
        /* Make server socket. */
-       memset(&serv, 0, sizeof(struct sockaddr_un));
+       memset(&serv, 0, sizeof(serv));
        serv.sun_family = AF_UNIX;
        strlcpy(serv.sun_path, path, sizeof(serv.sun_path));
 #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
@@ -1976,7 +1976,7 @@ static void vtysh_accept(struct thread *thread)
 
        vty_event_serv(VTYSH_SERV, vtyserv);
 
-       memset(&client, 0, sizeof(struct sockaddr_un));
+       memset(&client, 0, sizeof(client));
        client_len = sizeof(struct sockaddr_un);
 
        sock = accept(accept_sock, (struct sockaddr *)&client,
index 56adde406eef992e6548329c1ac0134fb637dc68..6ba2399e05562530649f0db44a3ae373c84a8f57 100644 (file)
@@ -600,7 +600,7 @@ int sock_open_unix(const char *path)
        if (fd < 0)
                return -1;
 
-       memset(&addr, 0, sizeof(struct sockaddr_un));
+       memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
        strlcpy(addr.sun_path, path, sizeof(addr.sun_path));
 
index 0ca4eb3d5daf985c80a4ebda6fa5bc844ff3dad5..899c78c9fbd4aa45fc566f8e087907e2b81a97bd 100644 (file)
@@ -628,7 +628,7 @@ void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa)
        if (CHECK_FLAG(external->bits_metric, OSPF6_ASBR_BIT_F)) {
                offset = sizeof(*external)
                         + OSPF6_PREFIX_SPACE(external->prefix.prefix_length);
-               memset(&fwd_addr, 0, sizeof(struct prefix));
+               memset(&fwd_addr, 0, sizeof(fwd_addr));
                fwd_addr.family = AF_INET6;
                fwd_addr.prefixlen = IPV6_MAX_BITLEN;
                memcpy(&fwd_addr.u.prefix6, (caddr_t)external + offset,
index 1f3f87751a90fb0146d3e51bfaa66a10be4e6f5a..77ac4a18777e4ce676c250976e3a0e6fcc7fc331 100644 (file)
@@ -406,7 +406,7 @@ int ospf6_auth_validate_pkt(struct ospf6_interface *oi, unsigned int *pkt_len,
                return OSPF6_AUTH_VALIDATE_FAILURE;
        }
 
-       memset(&ospf6_auth_info, 0, sizeof(struct ospf6_auth_hdr));
+       memset(&ospf6_auth_info, 0, sizeof(ospf6_auth_info));
        if ((*pkt_len - hdr_len - (*lls_block_len)) > sizeof(ospf6_auth_info)) {
                if (IS_OSPF6_DEBUG_AUTH_RX)
                        zlog_err("RECV[%s] : Wrong auth data in %s packet",
index f3fd9dab66e4f2a678a28e0bc5f2c61a8ebd19ec..b5ea3ada36337610437867334f180028d59f54f3 100644 (file)
@@ -2010,7 +2010,7 @@ void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa)
                        break;
                prefix_num--;
 
-               memset(&prefix, 0, sizeof(struct prefix));
+               memset(&prefix, 0, sizeof(prefix));
                prefix.family = AF_INET6;
                prefix.prefixlen = op->prefix_length;
                ospf6_prefix_in6_addr(&prefix.u.prefix6, intra_prefix_lsa, op);
index 7501f49fe02f2116457a169a0b6f5b79b3fa71de..9a549e2fc7e5b499aa649a1a23fa42bb0f588217 100644 (file)
@@ -173,7 +173,7 @@ int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
        memset(&cmsgbuf, 0, sizeof(cmsgbuf));
        scmsgp = (struct cmsghdr *)&cmsgbuf;
        pktinfo = (struct in6_pktinfo *)(CMSG_DATA(scmsgp));
-       memset(&dst_sin6, 0, sizeof(struct sockaddr_in6));
+       memset(&dst_sin6, 0, sizeof(dst_sin6));
 
        /* source address */
        pktinfo->ipi6_ifindex = ifindex;
@@ -226,7 +226,7 @@ int ospf6_recvmsg(struct in6_addr *src, struct in6_addr *dst,
 
        rcmsgp = (struct cmsghdr *)cmsgbuf;
        pktinfo = (struct in6_pktinfo *)(CMSG_DATA(rcmsgp));
-       memset(&src_sin6, 0, sizeof(struct sockaddr_in6));
+       memset(&src_sin6, 0, sizeof(src_sin6));
 
        /* receive control msg */
        rcmsgp->cmsg_level = IPPROTO_IPV6;
index 3c74ca55c1d28621e78022b7fe4aba432f4050c8..8e964393f100d81076014c633229c3b15e99e011 100644 (file)
@@ -1550,7 +1550,7 @@ int ospf6_route_table_show(struct vty *vty, int argc_start, int argc,
        int arg_end = use_json ? (argc - 1) : argc;
        json_object *json = NULL;
 
-       memset(&prefix, 0, sizeof(struct prefix));
+       memset(&prefix, 0, sizeof(prefix));
 
        if (use_json)
                json = json_object_new_object();
@@ -1723,9 +1723,9 @@ int ospf6_linkstate_table_show(struct vty *vty, int idx_ipv4, int argc,
        int i, ret;
        struct prefix router, id, prefix;
 
-       memset(&router, 0, sizeof(struct prefix));
-       memset(&id, 0, sizeof(struct prefix));
-       memset(&prefix, 0, sizeof(struct prefix));
+       memset(&router, 0, sizeof(router));
+       memset(&id, 0, sizeof(id));
+       memset(&prefix, 0, sizeof(prefix));
 
        for (i = idx_ipv4; i < argc; i++) {
                if (strmatch(argv[i]->text, "detail")) {
index 634eabbf700607468bc98b02dcdf2a2cf8c8576c..8f482d707771ac8d9157849dcc945ca451301111 100644 (file)
@@ -579,7 +579,7 @@ static void ospf6_disable(struct ospf6 *o)
 
 void ospf6_master_init(struct thread_master *master)
 {
-       memset(&ospf6_master, 0, sizeof(struct ospf6_master));
+       memset(&ospf6_master, 0, sizeof(ospf6_master));
 
        om6 = &ospf6_master;
        om6->ospf6 = list_new();
@@ -1758,7 +1758,7 @@ bool ospf6_is_valid_summary_addr(struct vty *vty, struct prefix *p)
 {
        struct in6_addr addr_zero;
 
-       memset(&addr_zero, 0, sizeof(struct in6_addr));
+       memset(&addr_zero, 0, sizeof(addr_zero));
 
         /* Default prefix validation*/
        if ((is_default_prefix(p)) ||
index 18b1959b9b6d9bbf2ef559004c5fe917002175d1..836671658527b5a5b22c63552468d696bff354b7 100644 (file)
@@ -241,7 +241,7 @@ static int ospf6_zebra_gr_update(struct ospf6 *ospf6, int command,
        if (!zclient || zclient->sock < 0 || !ospf6)
                return 1;
 
-       memset(&api, 0, sizeof(struct zapi_cap));
+       memset(&api, 0, sizeof(api));
        api.cap = command;
        api.stale_removal_time = stale_time;
        api.vrf_id = ospf6->vrf_id;
index 1908604bd9c5217c2a1186854054057ea173a04d..e84c6f5b3c975f51187a812dfd7b75ee9323c049 100644 (file)
@@ -124,7 +124,7 @@ struct ospf_apiclient *ospf_apiclient_connect(char *host, int syncport)
 
        /* Prepare socket for asynchronous messages */
        /* Initialize async address structure */
-       memset(&myaddr_async, 0, sizeof(struct sockaddr_in));
+       memset(&myaddr_async, 0, sizeof(myaddr_async));
        myaddr_async.sin_family = AF_INET;
        myaddr_async.sin_addr.s_addr = htonl(INADDR_ANY);
        myaddr_async.sin_port = htons(syncport + 1);
@@ -219,7 +219,7 @@ struct ospf_apiclient *ospf_apiclient_connect(char *host, int syncport)
           want the sync port number on a fixed port number. The reverse
           async channel will be at this port+1 */
 
-       memset(&myaddr_sync, 0, sizeof(struct sockaddr_in));
+       memset(&myaddr_sync, 0, sizeof(myaddr_sync));
        myaddr_sync.sin_family = AF_INET;
        myaddr_sync.sin_port = htons(syncport);
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
index 97bd125aee98e4db22dfc8d2870a18b9880dcf6f..5229c6f44cbf68d835cb20528173d6db85c991eb 100644 (file)
@@ -615,7 +615,7 @@ void ospf_apiserver_accept(struct thread *thread)
        /* Get port address and port number of peer to make reverse connection.
           The reverse channel uses the port number of the peer port+1. */
 
-       memset(&peer_sync, 0, sizeof(struct sockaddr_in));
+       memset(&peer_sync, 0, sizeof(peer_sync));
        peerlen = sizeof(struct sockaddr_in);
 
        ret = getpeername(new_sync_sock, (struct sockaddr *)&peer_sync,
index 9d4ce97fa5f98c72a7acf159849a11504a7b85ae..2d746946a5c2f59e07c750713ec5c5611d68d55f 100644 (file)
@@ -648,7 +648,7 @@ struct ospf_lsa *ospf_originate_summary_lsa(struct ospf *ospf,
        }
 
        /* Prepare the extrenal_info for aggregator */
-       memset(&ei_aggr, 0, sizeof(struct external_info));
+       memset(&ei_aggr, 0, sizeof(ei_aggr));
        ei_aggr.p = aggr->p;
        ei_aggr.tag = aggr->tag;
        ei_aggr.type = 0;
@@ -1011,7 +1011,7 @@ static void ospf_handle_external_aggr_update(struct ospf *ospf)
                        aggr->action = OSPF_ROUTE_AGGR_NONE;
 
                        /* Prepare the extrenal_info for aggregator */
-                       memset(&ei_aggr, 0, sizeof(struct external_info));
+                       memset(&ei_aggr, 0, sizeof(ei_aggr));
                        ei_aggr.p = aggr->p;
                        ei_aggr.tag = aggr->tag;
                        ei_aggr.type = 0;
index 69847088e44b945c5462c1f95ad378f8a97ec155..1288686a1028e5bfe3f26699030280054d16cd97 100644 (file)
@@ -114,7 +114,7 @@ int ospf_ext_init(void)
 {
        int rc = 0;
 
-       memset(&OspfEXT, 0, sizeof(struct ospf_ext_lp));
+       memset(&OspfEXT, 0, sizeof(OspfEXT));
        OspfEXT.enabled = false;
        /* Only Area flooding is supported yet */
        OspfEXT.scope = OSPF_OPAQUE_AREA_LSA;
index 59e1b73d24cd8aa88c86134a012277f640a0b370..2be81042a682f4ad3eaf6dbf1c5b8acd6fbb75a3 100644 (file)
@@ -3149,7 +3149,7 @@ void ospf_lsa_maxage_delete(struct ospf *ospf, struct ospf_lsa *lsa)
        struct route_node *rn;
        struct prefix lsa_prefix;
 
-       memset(&lsa_prefix, 0, sizeof(struct prefix));
+       memset(&lsa_prefix, 0, sizeof(lsa_prefix));
        lsa_prefix.family = AF_UNSPEC;
        lsa_prefix.prefixlen = sizeof(lsa_prefix.u.ptr) * CHAR_BIT;
        lsa_prefix.u.ptr = (uintptr_t)lsa;
@@ -3190,7 +3190,7 @@ void ospf_lsa_maxage(struct ospf *ospf, struct ospf_lsa *lsa)
                return;
        }
 
-       memset(&lsa_prefix, 0, sizeof(struct prefix));
+       memset(&lsa_prefix, 0, sizeof(lsa_prefix));
        lsa_prefix.family = AF_UNSPEC;
        lsa_prefix.prefixlen = sizeof(lsa_prefix.u.ptr) * CHAR_BIT;
        lsa_prefix.u.ptr = (uintptr_t)lsa;
@@ -3865,8 +3865,7 @@ struct ospf_lsa *ospf_lsa_refresh(struct ospf *ospf, struct ospf_lsa *lsa)
                        if (aggr) {
                                struct external_info ei_aggr;
 
-                               memset(&ei_aggr, 0,
-                                       sizeof(struct external_info));
+                               memset(&ei_aggr, 0, sizeof(ei_aggr));
                                ei_aggr.p = aggr->p;
                                ei_aggr.tag = aggr->tag;
                                ei_aggr.instance = ospf->instance;
index b0881c098f568919b3f47a00468a663aa024b927..f4fb858a5f4b2fbb0ca2e7dae7e3e9a26ccea75e 100644 (file)
@@ -198,7 +198,7 @@ struct ospf_lsa *ospf_lsdb_lookup_by_id(struct ospf_lsdb *lsdb, uint8_t type,
 
        table = lsdb->type[type].db;
 
-       memset(&lp, 0, sizeof(struct prefix_ls));
+       memset(&lp, 0, sizeof(lp));
        lp.family = AF_UNSPEC;
        lp.prefixlen = 64;
        lp.id = id;
@@ -225,7 +225,7 @@ struct ospf_lsa *ospf_lsdb_lookup_by_id_next(struct ospf_lsdb *lsdb,
 
        table = lsdb->type[type].db;
 
-       memset(&lp, 0, sizeof(struct prefix_ls));
+       memset(&lp, 0, sizeof(lp));
        lp.family = AF_UNSPEC;
        lp.prefixlen = 64;
        lp.id = id;
index 55a010a293f7fb4f26679d03b4033c7458142b10..c319f8068a06bd30b5a23097b06995f5167dae66 100644 (file)
@@ -696,7 +696,7 @@ static void ospf_write(struct thread *thread)
                /* reset get pointer */
                stream_set_getp(op->s, 0);
 
-               memset(&iph, 0, sizeof(struct ip));
+               memset(&iph, 0, sizeof(iph));
                memset(&sa_dst, 0, sizeof(sa_dst));
 
                sa_dst.sin_family = AF_INET;
@@ -2310,7 +2310,7 @@ static struct stream *ospf_recv_packet(struct ospf *ospf, int fd,
        char buff[CMSG_SPACE(SOPT_SIZE_CMSG_IFINDEX_IPV4())];
        struct msghdr msgh;
 
-       memset(&msgh, 0, sizeof(struct msghdr));
+       memset(&msgh, 0, sizeof(msgh));
        msgh.msg_iov = &iov;
        msgh.msg_iovlen = 1;
        msgh.msg_control = (caddr_t)buff;
index 3efdb53102b1cf059407aa75176c73fd1ae4681c..e227a3151fe5f50240bed3a0deba6bedaa608142 100644 (file)
@@ -90,7 +90,7 @@ int ospf_router_info_init(void)
 
        zlog_info("RI (%s): Initialize Router Information", __func__);
 
-       memset(&OspfRI, 0, sizeof(struct ospf_router_info));
+       memset(&OspfRI, 0, sizeof(OspfRI));
        OspfRI.enabled = false;
        OspfRI.registered = 0;
        OspfRI.scope = OSPF_OPAQUE_AS_LSA;
index bf375568633ae756fa3fc1066f745c16bd7df345..9727c7039c5ee0bf9c3c95000a5629de9c9f0ecc 100644 (file)
@@ -693,7 +693,7 @@ static uint8_t *ospfAreaEntry(struct variable *v, oid *name, size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        area = ospfAreaLookup(v, name, length, &addr, exact);
        if (!area)
@@ -821,7 +821,7 @@ static uint8_t *ospfStubAreaEntry(struct variable *v, oid *name, size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        area = ospfStubAreaLookup(v, name, length, &addr, exact);
        if (!area)
@@ -1044,10 +1044,10 @@ static uint8_t *ospfLsdbEntry(struct variable *v, oid *name, size_t *length,
        /* INDEX { ospfLsdbAreaId, ospfLsdbType,
           ospfLsdbLsid, ospfLsdbRouterId } */
 
-       memset(&area_id, 0, sizeof(struct in_addr));
+       memset(&area_id, 0, sizeof(area_id));
        type = 0;
-       memset(&ls_id, 0, sizeof(struct in_addr));
-       memset(&router_id, 0, sizeof(struct in_addr));
+       memset(&ls_id, 0, sizeof(ls_id));
+       memset(&router_id, 0, sizeof(router_id));
 
        /* Check OSPF instance. */
        ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
@@ -1279,7 +1279,7 @@ static uint8_t *ospfHostEntry(struct variable *v, oid *name, size_t *length,
        if (ospf == NULL)
                return NULL;
 
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        nbr_nbma = ospfHostLookup(v, name, length, &addr, exact);
        if (nbr_nbma == NULL)
@@ -1595,7 +1595,7 @@ static uint8_t *ospfIfEntry(struct variable *v, oid *name, size_t *length,
                return NULL;
 
        ifindex = 0;
-       memset(&ifaddr, 0, sizeof(struct in_addr));
+       memset(&ifaddr, 0, sizeof(ifaddr));
 
        /* Check OSPF instance. */
        ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
@@ -1742,7 +1742,7 @@ static uint8_t *ospfIfMetricEntry(struct variable *v, oid *name, size_t *length,
                return NULL;
 
        ifindex = 0;
-       memset(&ifaddr, 0, sizeof(struct in_addr));
+       memset(&ifaddr, 0, sizeof(ifaddr));
 
        /* Check OSPF instance. */
        ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
@@ -1778,7 +1778,7 @@ static int ospf_snmp_vl_add(struct ospf_vl_data *vl_data)
        struct prefix_ls lp;
        struct route_node *rn;
 
-       memset(&lp, 0, sizeof(struct prefix_ls));
+       memset(&lp, 0, sizeof(lp));
        lp.family = AF_UNSPEC;
        lp.prefixlen = 64;
        lp.id = vl_data->vl_area_id;
@@ -1797,7 +1797,7 @@ static int ospf_snmp_vl_delete(struct ospf_vl_data *vl_data)
        struct prefix_ls lp;
        struct route_node *rn;
 
-       memset(&lp, 0, sizeof(struct prefix_ls));
+       memset(&lp, 0, sizeof(lp));
        lp.family = AF_UNSPEC;
        lp.prefixlen = 64;
        lp.id = vl_data->vl_area_id;
@@ -1819,7 +1819,7 @@ static struct ospf_vl_data *ospf_snmp_vl_lookup(struct in_addr *area_id,
        struct route_node *rn;
        struct ospf_vl_data *vl_data;
 
-       memset(&lp, 0, sizeof(struct prefix_ls));
+       memset(&lp, 0, sizeof(lp));
        lp.family = AF_UNSPEC;
        lp.prefixlen = 64;
        lp.id = *area_id;
@@ -1842,7 +1842,7 @@ static struct ospf_vl_data *ospf_snmp_vl_lookup_next(struct in_addr *area_id,
        struct route_node *rn;
        struct ospf_vl_data *vl_data;
 
-       memset(&lp, 0, sizeof(struct prefix_ls));
+       memset(&lp, 0, sizeof(lp));
        lp.family = AF_UNSPEC;
        lp.prefixlen = 64;
        lp.id = *area_id;
@@ -1927,8 +1927,8 @@ static uint8_t *ospfVirtIfEntry(struct variable *v, oid *name, size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&area_id, 0, sizeof(struct in_addr));
-       memset(&neighbor, 0, sizeof(struct in_addr));
+       memset(&area_id, 0, sizeof(area_id));
+       memset(&neighbor, 0, sizeof(neighbor));
 
        vl_data = ospfVirtIfLookup(v, name, length, &area_id, &neighbor, exact);
        if (!vl_data)
@@ -2139,7 +2139,7 @@ static uint8_t *ospfNbrEntry(struct variable *v, oid *name, size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&nbr_addr, 0, sizeof(struct in_addr));
+       memset(&nbr_addr, 0, sizeof(nbr_addr));
        ifindex = 0;
 
        nbr = ospfNbrLookup(v, name, length, &nbr_addr, &ifindex, exact);
@@ -2190,8 +2190,8 @@ static uint8_t *ospfVirtNbrEntry(struct variable *v, oid *name, size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&area_id, 0, sizeof(struct in_addr));
-       memset(&neighbor, 0, sizeof(struct in_addr));
+       memset(&area_id, 0, sizeof(area_id));
+       memset(&neighbor, 0, sizeof(neighbor));
 
        /* Check OSPF instance. */
        ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
@@ -2331,8 +2331,8 @@ static uint8_t *ospfExtLsdbEntry(struct variable *v, oid *name, size_t *length,
                return NULL;
 
        type = OSPF_AS_EXTERNAL_LSA;
-       memset(&ls_id, 0, sizeof(struct in_addr));
-       memset(&router_id, 0, sizeof(struct in_addr));
+       memset(&ls_id, 0, sizeof(ls_id));
+       memset(&router_id, 0, sizeof(router_id));
 
        /* Check OSPF instance. */
        ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
index 090a655cee37e9a386b3f4cc7d67610fb916bc8f..8fa5ce77bb19ee4f42723b37bb62e016a1220f12 100644 (file)
@@ -608,7 +608,7 @@ int ospf_sr_init(void)
 
        osr_debug("SR (%s): Initialize SR Data Base", __func__);
 
-       memset(&OspfSR, 0, sizeof(struct ospf_sr_db));
+       memset(&OspfSR, 0, sizeof(OspfSR));
        OspfSR.status = SR_OFF;
        /* Only AREA flooding is supported in this release */
        OspfSR.scope = OSPF_OPAQUE_AREA_LSA;
index ddc62982bdbe039f235df6f2d4a70b68c09f0115..75f4e0c9f094db62bb6f491cb19ca666e2db1c0d 100644 (file)
@@ -159,7 +159,7 @@ int ospf_mpls_te_init(void)
                return rc;
        }
 
-       memset(&OspfMplsTE, 0, sizeof(struct ospf_mpls_te));
+       memset(&OspfMplsTE, 0, sizeof(OspfMplsTE));
        OspfMplsTE.enabled = false;
        OspfMplsTE.export = false;
        OspfMplsTE.inter_as = Off;
index 496d85fd7bc955ecb30d3a509916f1d6646efb3b..46eb6253832f261e8524dc5406e732a02859147e 100644 (file)
@@ -1253,7 +1253,7 @@ static int ospf_zebra_gr_update(struct ospf *ospf, int command,
        if (!zclient || zclient->sock < 0 || !ospf)
                return 1;
 
-       memset(&api, 0, sizeof(struct zapi_cap));
+       memset(&api, 0, sizeof(api));
        api.cap = command;
        api.stale_removal_time = stale_time;
        api.vrf_id = ospf->vrf_id;
index 221f6e7e4e2600713647059fd3ee780c626f1f58..337456ecd8227bc09572f08e717bb2183153e781 100644 (file)
@@ -2114,7 +2114,7 @@ int ospf_nbr_nbma_poll_interval_unset(struct ospf *ospf, struct in_addr addr)
 
 void ospf_master_init(struct thread_master *master)
 {
-       memset(&ospf_master, 0, sizeof(struct ospf_master));
+       memset(&ospf_master, 0, sizeof(ospf_master));
 
        om = &ospf_master;
        om->ospf = list_new();
index a6f253d3e32451511372fe76e21936b3c6a3da8c..d2b49a7d955ee6b38cb01edb4077c94ec1dcea8c 100644 (file)
@@ -1027,7 +1027,7 @@ static int path_pcep_cli_pcc_pcc_peer(struct vty *vty, const char *peer_name,
 
        /* Verify the PCE has the IP set */
        struct in6_addr zero_v6_addr;
-       memset(&zero_v6_addr, 0, sizeof(struct in6_addr));
+       memset(&zero_v6_addr, 0, sizeof(zero_v6_addr));
        if (memcmp(&pce_opts->addr.ip, &zero_v6_addr, IPADDRSZ(&pce_opts->addr))
            == 0) {
                vty_out(vty,
index 649704f55b99a90ffe179ef0b01867fb978e858d..18ccf250ae83ad643a5e164faa0e24753ff93272 100644 (file)
@@ -215,7 +215,7 @@ void handle_signal_action(int sig_number)
 int setup_signals()
 {
        struct sigaction sa;
-       memset(&sa, 0, sizeof(struct sigaction));
+       memset(&sa, 0, sizeof(sa));
        sa.sa_handler = handle_signal_action;
        if (sigaction(SIGINT, &sa, 0) != 0) {
                perror("sigaction()");
index ac46605dbdc96643c9f52b54660b32c12f0522bb..22716c2a9201909968f15ec069071e9ffe06d46f 100644 (file)
@@ -114,7 +114,7 @@ static struct pim_nexthop_cache *pim_nht_get(struct pim_instance *pim,
        struct zclient *zclient = NULL;
 
        zclient = pim_zebra_zclient_get();
-       memset(&rpf, 0, sizeof(struct pim_rpf));
+       memset(&rpf, 0, sizeof(rpf));
        rpf.rpf_addr = *addr;
 
        pnc = pim_nexthop_cache_find(pim, &rpf);
index fef5339749cf1023b5f0bff6de27345bea20e8a6..f86453f936b8cd17ce4889a20fd2f236b8b65c96 100644 (file)
@@ -305,7 +305,7 @@ void pim_null_register_send(struct pim_upstream *up)
                return;
        }
 
-       memset(&ip_hdr, 0, sizeof(struct ip));
+       memset(&ip_hdr, 0, sizeof(ip_hdr));
        ip_hdr.ip_p = PIM_IP_PROTO_PIM;
        ip_hdr.ip_hl = 5;
        ip_hdr.ip_v = 4;
index d41bc3f4364371f46cdfda257267d5f11b9d8202..321775cce3dd39c308da35719d1527cd3c29d96e 100644 (file)
@@ -360,7 +360,7 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
                        *tolen = sizeof(*to);
        }
 
-       memset(&msgh, 0, sizeof(struct msghdr));
+       memset(&msgh, 0, sizeof(msgh));
        iov.iov_base = buf;
        iov.iov_len = len;
        msgh.msg_control = cbuf;
index 042c9713b266af99264b918b929b28eb0aece5cc..7ac37b7ee2e8315df474ed3d1c869a03ec6c29e1 100644 (file)
@@ -929,7 +929,7 @@ int rip_neighbor_lookup(struct rip *rip, struct sockaddr_in *from)
        struct prefix_ipv4 p;
        struct route_node *node;
 
-       memset(&p, 0, sizeof(struct prefix_ipv4));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET;
        p.prefix = from->sin_addr;
        p.prefixlen = IPV4_MAX_BITLEN;
index c640ca27af8d170e391f5f02e7a146b5a4cc217b..5b1917e17af5e59d94310ba252e57af6c10cdcbf 100644 (file)
@@ -132,7 +132,7 @@ int ripd_instance_default_information_originate_modify(
        rip = nb_running_get_entry(args->dnode, NULL, true);
        default_information = yang_dnode_get_bool(args->dnode, NULL);
 
-       memset(&p, 0, sizeof(struct prefix_ipv4));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET;
        if (default_information) {
                struct nexthop nh;
index 436dc4de0e4cc9ade7184320335cc24d91b3a457..0ce3804069ee009c6242884675f1b08d8ad3d3bb 100644 (file)
@@ -356,7 +356,7 @@ static uint8_t *rip2IfStatEntry(struct variable *v, oid name[], size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        /* Lookup interface. */
        ifp = rip2IfLookup(v, name, length, &addr, exact);
@@ -457,7 +457,7 @@ static uint8_t *rip2IfConfAddress(struct variable *v, oid name[],
            == MATCH_FAILED)
                return NULL;
 
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        /* Lookup interface. */
        ifp = rip2IfLookup(v, name, length, &addr, exact);
@@ -529,7 +529,7 @@ static uint8_t *rip2PeerTable(struct variable *v, oid name[], size_t *length,
            == MATCH_FAILED)
                return NULL;
 
-       memset(&addr, 0, sizeof(struct in_addr));
+       memset(&addr, 0, sizeof(addr));
 
        /* Lookup interface. */
        peer = rip2PeerLookup(v, name, length, &addr, exact);
index 74a06b68939eff65f5c904797040b424460c56a7..cc21c0bd69166e4ba93fd7d8b12c8c9557617f2b 100644 (file)
@@ -1475,7 +1475,7 @@ static int rip_send_packet(uint8_t *buf, int size, struct sockaddr_in *to,
        }
 
        /* Make destination address. */
-       memset(&sin, 0, sizeof(struct sockaddr_in));
+       memset(&sin, 0, sizeof(sin));
        sin.sin_family = AF_INET;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
        sin.sin_len = sizeof(struct sockaddr_in);
@@ -1543,7 +1543,7 @@ void rip_redistribute_add(struct rip *rip, int type, int sub_type,
 
        rp = route_node_get(rip->table, (struct prefix *)p);
 
-       memset(&newinfo, 0, sizeof(struct rip_info));
+       memset(&newinfo, 0, sizeof(newinfo));
        newinfo.type = type;
        newinfo.sub_type = sub_type;
        newinfo.metric = 1;
@@ -1737,7 +1737,7 @@ static void rip_read(struct thread *t)
        rip_event(rip, RIP_READ, sock);
 
        /* RIPd manages only IPv4. */
-       memset(&from, 0, sizeof(struct sockaddr_in));
+       memset(&from, 0, sizeof(from));
        fromlen = sizeof(struct sockaddr_in);
 
        len = recvfrom(sock, (char *)&rip_buf.buf, sizeof(rip_buf.buf), 0,
@@ -2384,7 +2384,7 @@ static void rip_update_interface(struct connected *ifc, uint8_t version,
        if (if_is_broadcast(ifp) || if_is_pointopoint(ifp)) {
                if (ifc->address->family == AF_INET) {
                        /* Destination address and port setting. */
-                       memset(&to, 0, sizeof(struct sockaddr_in));
+                       memset(&to, 0, sizeof(to));
                        if (ifc->destination)
                                /* use specified broadcast or peer destination
                                 * addr */
@@ -2833,7 +2833,7 @@ uint8_t rip_distance_apply(struct rip *rip, struct rip_info *rinfo)
        struct rip_distance *rdistance;
        struct access_list *alist;
 
-       memset(&p, 0, sizeof(struct prefix_ipv4));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET;
        p.prefix = rinfo->from;
        p.prefixlen = IPV4_MAX_BITLEN;
index 5fc1e34592418dc46f9093c7a836c00b6c77d34a..e7d292869782042f547156c47bc87754216ba34a 100644 (file)
@@ -196,7 +196,7 @@ int ripng_send_packet(caddr_t buf, int bufsize, struct sockaddr_in6 *to,
                zlog_debug("  send packet size %d", bufsize);
        }
 
-       memset(&addr, 0, sizeof(struct sockaddr_in6));
+       memset(&addr, 0, sizeof(addr));
        addr.sin6_family = AF_INET6;
 #ifdef SIN6_LEN
        addr.sin6_len = sizeof(struct sockaddr_in6);
@@ -259,7 +259,7 @@ static int ripng_recv_packet(int sock, uint8_t *buf, int bufsize,
        struct cmsghdr *cmsgptr;
        struct in6_addr dst = {.s6_addr = {0}};
 
-       memset(&dst, 0, sizeof(struct in6_addr));
+       memset(&dst, 0, sizeof(dst));
 
        /* Ancillary data.  This store cmsghdr and in6_pktinfo.  But at this
           point I can't determine size of cmsghdr */
@@ -940,7 +940,7 @@ void ripng_redistribute_add(struct ripng *ripng, int type, int sub_type,
 
        rp = agg_node_get(ripng->table, (struct prefix *)p);
 
-       memset(&newinfo, 0, sizeof(struct ripng_info));
+       memset(&newinfo, 0, sizeof(newinfo));
        newinfo.type = type;
        newinfo.sub_type = sub_type;
        newinfo.ifindex = ifindex;
@@ -1145,7 +1145,7 @@ static void ripng_response_process(struct ripng_packet *packet, int size,
        ripng_peer_update(ripng, from, packet->version);
 
        /* Reset nexthop. */
-       memset(&nexthop, 0, sizeof(struct ripng_nexthop));
+       memset(&nexthop, 0, sizeof(nexthop));
        nexthop.flag = RIPNG_NEXTHOP_UNSPEC;
 
        /* Set RTE pointer. */
@@ -1272,7 +1272,7 @@ static void ripng_request_process(struct ripng_packet *packet, int size,
                   field.  Once all the entries have been filled in, change the
                   command from Request to Response and send the datagram back
                   to the requestor. */
-               memset(&p, 0, sizeof(struct prefix_ipv6));
+               memset(&p, 0, sizeof(p));
                p.family = AF_INET6;
 
                for (; ((caddr_t)rte) < lim; rte++) {
index 74886254bdb936e22e78e089eeea48f5b7e9f962..828d2d73b0fec2a589a416e394c9d0ddb39eaf2b 100644 (file)
@@ -4119,7 +4119,7 @@ static int vtysh_connect(struct vtysh_client *vclient)
                return -1;
        }
 
-       memset(&addr, 0, sizeof(struct sockaddr_un));
+       memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
        strlcpy(addr.sun_path, path, sizeof(addr.sun_path));
 #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
index 51e4f802c9a430cbc33d5d712286d3a7da87f15f..fc285c748aa0266942529454bf12407fc69f25a5 100644 (file)
@@ -798,7 +798,7 @@ static int try_connect(struct daemon *dmn)
                zlog_debug("%s: attempting to connect", dmn->name);
        dmn->connect_tries++;
 
-       memset(&addr, 0, sizeof(struct sockaddr_un));
+       memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
        snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s.vty", gs.vtydir,
                 dmn->name);
index eb2720335e5978bb2ea5010cbbd332734ad653d9..c01be58e826813582fac3ceeadafa9eae6357a49 100644 (file)
@@ -512,14 +512,14 @@ void connected_delete_ipv4(struct interface *ifp, int flags,
        struct prefix p, d;
        struct connected *ifc;
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET;
        p.u.prefix4 = *addr;
        p.prefixlen =
                CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_BITLEN : prefixlen;
 
        if (dest) {
-               memset(&d, 0, sizeof(struct prefix));
+               memset(&d, 0, sizeof(d));
                d.family = AF_INET;
                d.u.prefix4 = *dest;
                d.prefixlen = prefixlen;
@@ -603,7 +603,7 @@ void connected_delete_ipv6(struct interface *ifp,
        struct prefix p, d;
        struct connected *ifc;
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET6;
        memcpy(&p.u.prefix6, address, sizeof(struct in6_addr));
        p.prefixlen = prefixlen;
@@ -613,7 +613,7 @@ void connected_delete_ipv6(struct interface *ifp,
                rtadv_delete_prefix(ifp->info, &p);
 
        if (dest) {
-               memset(&d, 0, sizeof(struct prefix));
+               memset(&d, 0, sizeof(d));
                d.family = AF_INET6;
                IPV6_ADDR_COPY(&d.u.prefix6, dest);
                d.prefixlen = prefixlen;
index a895ed941005036a98a7e7f3de693c5d8a6fca2c..facd8e318d8620848d2f54f169f3d7fb3dc7bf50 100644 (file)
@@ -242,7 +242,7 @@ static int if_set_prefix_ctx(const struct zebra_dplane_ctx *ctx)
        strlcpy((char *)&addreq.ifra_name, dplane_ctx_get_ifname(ctx),
                sizeof(addreq.ifra_name));
 
-       memset(&addr, 0, sizeof(struct sockaddr_in));
+       memset(&addr, 0, sizeof(addr));
        addr.sin_addr = p->prefix;
        addr.sin_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -252,7 +252,7 @@ static int if_set_prefix_ctx(const struct zebra_dplane_ctx *ctx)
 
        if (dplane_ctx_intf_is_connected(ctx)) {
                p = (struct prefix_ipv4 *)dplane_ctx_get_intf_dest(ctx);
-               memset(&mask, 0, sizeof(struct sockaddr_in));
+               memset(&mask, 0, sizeof(mask));
                peer.sin_addr = p->prefix;
                peer.sin_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -262,7 +262,7 @@ static int if_set_prefix_ctx(const struct zebra_dplane_ctx *ctx)
                       sizeof(struct sockaddr_in));
        }
 
-       memset(&mask, 0, sizeof(struct sockaddr_in));
+       memset(&mask, 0, sizeof(mask));
        masklen2ip(p->prefixlen, &mask.sin_addr);
        mask.sin_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -293,7 +293,7 @@ static int if_unset_prefix_ctx(const struct zebra_dplane_ctx *ctx)
        strlcpy((char *)&addreq.ifra_name, dplane_ctx_get_ifname(ctx),
                sizeof(addreq.ifra_name));
 
-       memset(&addr, 0, sizeof(struct sockaddr_in));
+       memset(&addr, 0, sizeof(addr));
        addr.sin_addr = p->prefix;
        addr.sin_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -303,7 +303,7 @@ static int if_unset_prefix_ctx(const struct zebra_dplane_ctx *ctx)
 
        if (dplane_ctx_intf_is_connected(ctx)) {
                p = (struct prefix_ipv4 *)dplane_ctx_get_intf_dest(ctx);
-               memset(&mask, 0, sizeof(struct sockaddr_in));
+               memset(&mask, 0, sizeof(mask));
                peer.sin_addr = p->prefix;
                peer.sin_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -313,7 +313,7 @@ static int if_unset_prefix_ctx(const struct zebra_dplane_ctx *ctx)
                       sizeof(struct sockaddr_in));
        }
 
-       memset(&mask, 0, sizeof(struct sockaddr_in));
+       memset(&mask, 0, sizeof(mask));
        masklen2ip(p->prefixlen, &mask.sin_addr);
        mask.sin_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -394,7 +394,7 @@ int if_unset_prefix_ctx(const struct zebra_dplane_ctx *ctx)
        strlcpy(ifreq.ifr_name, dplane_ctx_get_ifname(ctx),
                sizeof(ifreq.ifr_name));
 
-       memset(&addr, 0, sizeof(struct sockaddr_in));
+       memset(&addr, 0, sizeof(addr));
        addr.sin_family = p->family;
        memcpy(&ifreq.ifr_addr, &addr, sizeof(struct sockaddr_in));
        ret = if_ioctl(SIOCSIFADDR, (caddr_t)&ifreq);
@@ -508,7 +508,7 @@ int if_set_flags(struct interface *ifp, uint64_t flags)
        int ret;
        struct ifreq ifreq;
 
-       memset(&ifreq, 0, sizeof(struct ifreq));
+       memset(&ifreq, 0, sizeof(ifreq));
        ifreq_set_name(&ifreq, ifp);
 
        ifreq.ifr_flags = ifp->flags;
@@ -529,7 +529,7 @@ int if_unset_flags(struct interface *ifp, uint64_t flags)
        int ret;
        struct ifreq ifreq;
 
-       memset(&ifreq, 0, sizeof(struct ifreq));
+       memset(&ifreq, 0, sizeof(ifreq));
        ifreq_set_name(&ifreq, ifp);
 
        ifreq.ifr_flags = ifp->flags;
@@ -568,7 +568,7 @@ static int if_set_prefix6_ctx(const struct zebra_dplane_ctx *ctx)
        strlcpy((char *)&addreq.ifra_name,
                dplane_ctx_get_ifname(ctx), sizeof(addreq.ifra_name));
 
-       memset(&addr, 0, sizeof(struct sockaddr_in6));
+       memset(&addr, 0, sizeof(addr));
        addr.sin6_addr = p->prefix;
        addr.sin6_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -576,7 +576,7 @@ static int if_set_prefix6_ctx(const struct zebra_dplane_ctx *ctx)
 #endif
        memcpy(&addreq.ifra_addr, &addr, sizeof(struct sockaddr_in6));
 
-       memset(&mask, 0, sizeof(struct sockaddr_in6));
+       memset(&mask, 0, sizeof(mask));
        masklen2ip6(p->prefixlen, &mask.sin6_addr);
        mask.sin6_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -615,7 +615,7 @@ static int if_unset_prefix6_ctx(const struct zebra_dplane_ctx *ctx)
        strlcpy((char *)&addreq.ifra_name,
                dplane_ctx_get_ifname(ctx), sizeof(addreq.ifra_name));
 
-       memset(&addr, 0, sizeof(struct sockaddr_in6));
+       memset(&addr, 0, sizeof(addr));
        addr.sin6_addr = p->prefix;
        addr.sin6_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
@@ -623,7 +623,7 @@ static int if_unset_prefix6_ctx(const struct zebra_dplane_ctx *ctx)
 #endif
        memcpy(&addreq.ifra_addr, &addr, sizeof(struct sockaddr_in6));
 
-       memset(&mask, 0, sizeof(struct sockaddr_in6));
+       memset(&mask, 0, sizeof(mask));
        masklen2ip6(p->prefixlen, &mask.sin6_addr);
        mask.sin6_family = p->family;
 #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
index d6ca92f54ed4c737370b160ea2922bf8bd0ed285..57fd304ae8d0292bf7bf946ec60e2eee153f0743 100644 (file)
@@ -1156,7 +1156,7 @@ int rtm_write(int message, union sockunion *dest, union sockunion *mask,
                return ZEBRA_ERR_EPERM;
 
        /* Clear and set rt_msghdr values */
-       memset(&msg, 0, sizeof(struct rt_msghdr));
+       memset(&msg, 0, sizeof(msg));
        msg.rtm.rtm_version = RTM_VERSION;
        msg.rtm.rtm_type = message;
        msg.rtm.rtm_seq = msg_seq++;
index 4e97323cf6f10d0e1aae9e73e4b1a45139b4a8dc..1803103a741649ebff59bc2164743018b8c9d70b 100644 (file)
@@ -3783,7 +3783,7 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
                return 0;
        }
 
-       memset(&ip, 0, sizeof(struct ipaddr));
+       memset(&ip, 0, sizeof(ip));
        ip.ipa_type = (ndm->ndm_family == AF_INET) ? IPADDR_V4 : IPADDR_V6;
        memcpy(&ip.ip.addr, RTA_DATA(tb[NDA_DST]), RTA_PAYLOAD(tb[NDA_DST]));
 
@@ -3863,7 +3863,7 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
                return 0;
        }
 
-       memset(&mac, 0, sizeof(struct ethaddr));
+       memset(&mac, 0, sizeof(mac));
        if (h->nlmsg_type == RTM_NEWNEIGH) {
                if (tb[NDA_LLADDR]) {
                        if (RTA_PAYLOAD(tb[NDA_LLADDR]) != ETH_ALEN) {
index ca833999cbb708035ffc3daeaa308b69f89f031c..e1d2016e66d5aebbca6a823c973882b90ccf07d8 100644 (file)
@@ -2847,7 +2847,7 @@ static int if_join_all_router(int sock, struct interface *ifp)
 
        struct ipv6_mreq mreq;
 
-       memset(&mreq, 0, sizeof(struct ipv6_mreq));
+       memset(&mreq, 0, sizeof(mreq));
        inet_pton(AF_INET6, ALLROUTER, &mreq.ipv6mr_multiaddr);
        mreq.ipv6mr_interface = ifp->ifindex;
 
@@ -2873,7 +2873,7 @@ static int if_leave_all_router(int sock, struct interface *ifp)
 
        struct ipv6_mreq mreq;
 
-       memset(&mreq, 0, sizeof(struct ipv6_mreq));
+       memset(&mreq, 0, sizeof(mreq));
        inet_pton(AF_INET6, ALLROUTER, &mreq.ipv6mr_multiaddr);
        mreq.ipv6mr_interface = ifp->ifindex;
 
index 9972d32fb7a20526f510d5533ce869f7fc0cb793..408d420be6ffff13a923482c3b4ffd1e051d4e4d 100644 (file)
@@ -1592,7 +1592,7 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh,
                 * the nexthop and associated MAC need to be installed.
                 */
                if (CHECK_FLAG(flags, ZEBRA_FLAG_EVPN_ROUTE)) {
-                       memset(&vtep_ip, 0, sizeof(struct ipaddr));
+                       memset(&vtep_ip, 0, sizeof(vtep_ip));
                        vtep_ip.ipa_type = IPADDR_V4;
                        memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4),
                               sizeof(struct in_addr));
@@ -1625,7 +1625,7 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh,
                 * the nexthop and associated MAC need to be installed.
                 */
                if (CHECK_FLAG(flags, ZEBRA_FLAG_EVPN_ROUTE)) {
-                       memset(&vtep_ip, 0, sizeof(struct ipaddr));
+                       memset(&vtep_ip, 0, sizeof(vtep_ip));
                        vtep_ip.ipa_type = IPADDR_V6;
                        memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6),
                               sizeof(struct in6_addr));
index 121092a55bd0cd701cf034e1f82778e0d01cd430..190341a85c637cd75650dd46151d7c00f2947912 100644 (file)
@@ -1000,7 +1000,7 @@ struct zebra_evpn *zebra_evpn_lookup(vni_t vni)
 
        zvrf = zebra_vrf_get_evpn();
        assert(zvrf);
-       memset(&tmp_vni, 0, sizeof(struct zebra_evpn));
+       memset(&tmp_vni, 0, sizeof(tmp_vni));
        tmp_vni.vni = vni;
        zevpn = hash_lookup(zvrf->evpn_table, &tmp_vni);
 
@@ -1019,7 +1019,7 @@ struct zebra_evpn *zebra_evpn_add(vni_t vni)
 
        zvrf = zebra_vrf_get_evpn();
        assert(zvrf);
-       memset(&tmp_zevpn, 0, sizeof(struct zebra_evpn));
+       memset(&tmp_zevpn, 0, sizeof(tmp_zevpn));
        tmp_zevpn.vni = vni;
        zevpn = hash_get(zvrf->evpn_table, &tmp_zevpn, zebra_evpn_alloc);
 
index 5a1f5af5d706e182ca3aa7d2706dd561c2aeff68..86364d08a0bf3966fedf28483e8c3d144d28a742 100644 (file)
@@ -1102,7 +1102,7 @@ struct zebra_mac *zebra_evpn_mac_add(struct zebra_evpn *zevpn,
        struct zebra_mac tmp_mac;
        struct zebra_mac *mac = NULL;
 
-       memset(&tmp_mac, 0, sizeof(struct zebra_mac));
+       memset(&tmp_mac, 0, sizeof(tmp_mac));
        memcpy(&tmp_mac.macaddr, macaddr, ETH_ALEN);
        mac = hash_get(zevpn->mac_table, &tmp_mac, zebra_evpn_mac_alloc);
 
@@ -1255,7 +1255,7 @@ void zebra_evpn_mac_del_all(struct zebra_evpn *zevpn, int uninstall,
        if (!zevpn->mac_table)
                return;
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.uninstall = uninstall;
        wctx.upd_client = upd_client;
@@ -1930,7 +1930,7 @@ void zebra_evpn_send_mac_list_to_client(struct zebra_evpn *zevpn)
        if (!zevpn->mac_table)
                return;
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
 
        hash_iterate(zevpn->mac_table, zebra_evpn_send_mac_hash_entry_to_client,
index 734a53c571b8dfa5bfbaf106d874807ec31b5959..b1bf09522dff8efa531c13d8fa81d290a0de9f66 100644 (file)
@@ -550,7 +550,7 @@ static struct zebra_neigh *zebra_evpn_neigh_add(struct zebra_evpn *zevpn,
        struct zebra_neigh tmp_n;
        struct zebra_neigh *n = NULL;
 
-       memset(&tmp_n, 0, sizeof(struct zebra_neigh));
+       memset(&tmp_n, 0, sizeof(tmp_n));
        memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr));
        n = hash_get(zevpn->neigh_table, &tmp_n, zebra_evpn_neigh_alloc);
 
@@ -881,7 +881,7 @@ void zebra_evpn_neigh_del_all(struct zebra_evpn *zevpn, int uninstall,
        if (!zevpn->neigh_table)
                return;
 
-       memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.uninstall = uninstall;
        wctx.upd_client = upd_client;
@@ -1653,7 +1653,7 @@ void zebra_evpn_send_neigh_to_client(struct zebra_evpn *zevpn)
 {
        struct neigh_walk_ctx wctx;
 
-       memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
 
        hash_iterate(zevpn->neigh_table,
index 7c57dfac6ad30dbb214cafdcae60b2e78b375322..39b7156ce4f0c91c3a23eb45fa5bda2ecaea81da 100644 (file)
@@ -1573,7 +1573,7 @@ static int zfpm_trigger_rmac_update(struct zebra_mac *rmac,
        vxlan_if = zl3vni_map_to_vxlan_if(zl3vni);
        svi_if = zl3vni_map_to_svi_if(zl3vni);
 
-       memset(&key, 0, sizeof(struct fpm_mac_info_t));
+       memset(&key, 0, sizeof(key));
 
        memcpy(&key.macaddr, &rmac->macaddr, ETH_ALEN);
        key.vni = zl3vni->vni;
index de7b6a177d99170ff87854d5b7f166f9f2c91f28..8237bebf3b1bb0a596ad4f7aa932ca8fd8392b09 100644 (file)
@@ -612,7 +612,7 @@ static int nhlfe_nexthop_active_ipv4(struct zebra_nhlfe *nhlfe,
                return 0;
 
        /* Lookup nexthop in IPv4 routing table. */
-       memset(&p, 0, sizeof(struct prefix_ipv4));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET;
        p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = nexthop->gate.ipv4;
@@ -661,7 +661,7 @@ static int nhlfe_nexthop_active_ipv6(struct zebra_nhlfe *nhlfe,
                return 0;
 
        /* Lookup nexthop in IPv6 routing table. */
-       memset(&p, 0, sizeof(struct prefix_ipv6));
+       memset(&p, 0, sizeof(p));
        p.family = AF_INET6;
        p.prefixlen = IPV6_MAX_BITLEN;
        p.prefix = nexthop->gate.ipv6;
index fd9b1ae387a14b2855ae2b516ce8ecd8b5e30158..ca66e0310a4fa8f35adfa0c105f6d3d34c841ca9 100644 (file)
@@ -206,7 +206,7 @@ static int zebra_mpls_bind(struct vty *vty, int add_cmd, const char *prefix,
                return CMD_WARNING_CONFIG_FAILED;
        }
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
        ret = str2prefix(prefix, &p);
        if (ret <= 0) {
                vty_out(vty, "%% Malformed address\n");
index af6046c9ade286c0a1b716c1a4f4491f29f3ad26..b3cb0612425cb134d3793b4cd2acce2f7c4b2021 100644 (file)
@@ -221,7 +221,7 @@ static bool zebra_ns_notify_is_default_netns(const char *name)
        if (zebra_ns_notify_self_identify(&default_netns_stat))
                return false;
 
-       memset(&st, 0, sizeof(struct stat));
+       memset(&st, 0, sizeof(st));
        snprintf(netnspath, sizeof(netnspath), "%s/%s", NS_RUN_DIR, name);
        /* compare with local stat */
        if (stat(netnspath, &st) == 0 &&
index c28e251e3a52d05a4c23b6986286847dfdb9eb38..fda5ef02cf1fb244e0afa653ad00ce8c6e879df1 100644 (file)
@@ -114,7 +114,7 @@ void zebra_ptm_init(void)
 {
        char buf[64];
 
-       memset(&ptm_cb, 0, sizeof(struct zebra_ptm_cb));
+       memset(&ptm_cb, 0, sizeof(ptm_cb));
 
        ptm_cb.out_data = calloc(1, ZEBRA_PTM_SEND_MAX_SOCKBUF);
        if (!ptm_cb.out_data) {
@@ -389,7 +389,7 @@ static int zebra_ptm_socket_init(void)
        }
 
        /* Make server socket. */
-       memset(&addr, 0, sizeof(struct sockaddr_un));
+       memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
        memcpy(&addr.sun_path, ZEBRA_PTM_SOCK_NAME,
               sizeof(ZEBRA_PTM_SOCK_NAME));
@@ -503,7 +503,7 @@ static int zebra_ptm_handle_bfd_msg(void *arg, void *in_ctxt,
                return -1;
        }
 
-       memset(&src_prefix, 0, sizeof(struct prefix));
+       memset(&src_prefix, 0, sizeof(src_prefix));
        if (strcmp(ZEBRA_PTM_INVALID_SRC_IP, src_str)) {
                if (str2prefix(src_str, &src_prefix) == 0) {
                        flog_err(EC_ZEBRA_PREFIX_PARSE_ERROR,
index 2732967ee6723ae956b23bd41325f603313a549d..e1da92403eca6feb72ff25ad80cfbca36b31324e 100644 (file)
@@ -381,7 +381,7 @@ struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
        if (!table)
                return 0;
 
-       memset(&p, 0, sizeof(struct prefix));
+       memset(&p, 0, sizeof(p));
        p.family = afi;
        if (afi == AFI_IP) {
                p.u.prefix4 = addr->ipv4;
index 020ff6f3c0967e2c30e24aa34cfb8c6a326bd05f..0d2dbbd18ef52a930cf84f5daddecc0e652fb86d 100644 (file)
@@ -275,7 +275,7 @@ static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket,
         * size, we try to be a bit more elegant in display by first computing
         * the maximum width.
         */
-       memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.addr_width = 15;
@@ -341,7 +341,7 @@ static void zevpn_print_neigh_hash_all_evpn_detail(struct hash_bucket *bucket,
                return;
        }
 
-       memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.addr_width = 15;
@@ -625,7 +625,7 @@ static void zl3vni_print_nh_hash_all_vni(struct hash_bucket *bucket,
        } else
                json_object_int_add(json_evpn, "numNextHops", num_nh);
 
-       memset(&wctx, 0, sizeof(struct nh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.vty = vty;
        wctx.json = json_evpn;
        hash_iterate(zl3vni->nh_table, zl3vni_print_nh_hash, &wctx);
@@ -668,7 +668,7 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_bucket *bucket,
         * under the vni. Re-assign primary json object to fill
         * next vni information.
         */
-       memset(&wctx, 0, sizeof(struct rmac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.vty = vty;
        wctx.json = json_evpn;
        hash_iterate(zl3vni->rmac_table, zl3vni_print_rmac_hash, &wctx);
@@ -1184,7 +1184,7 @@ static struct zebra_mac *zl3vni_rmac_add(struct zebra_l3vni *zl3vni,
        struct zebra_mac tmp_rmac;
        struct zebra_mac *zrmac = NULL;
 
-       memset(&tmp_rmac, 0, sizeof(struct zebra_mac));
+       memset(&tmp_rmac, 0, sizeof(tmp_rmac));
        memcpy(&tmp_rmac.macaddr, rmac, ETH_ALEN);
        zrmac = hash_get(zl3vni->rmac_table, &tmp_rmac, zl3vni_rmac_alloc);
        zrmac->nh_list = list_new();
@@ -1367,7 +1367,7 @@ static void zl3vni_remote_rmac_del(struct zebra_l3vni *zl3vni,
        struct ipaddr ipv4_vtep;
 
        if (!zl3vni_nh_lookup(zl3vni, vtep_ip)) {
-               memset(&ipv4_vtep, 0, sizeof(struct ipaddr));
+               memset(&ipv4_vtep, 0, sizeof(ipv4_vtep));
                ipv4_vtep.ipa_type = IPADDR_V4;
                if (vtep_ip->ipa_type == IPADDR_V6)
                        ipv4_mapped_ipv6_to_ipv4(&vtep_ip->ipaddr_v6,
@@ -1459,7 +1459,7 @@ static struct zebra_neigh *zl3vni_nh_add(struct zebra_l3vni *zl3vni,
        struct zebra_neigh tmp_n;
        struct zebra_neigh *n = NULL;
 
-       memset(&tmp_n, 0, sizeof(struct zebra_neigh));
+       memset(&tmp_n, 0, sizeof(tmp_n));
        memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr));
        n = hash_get(zl3vni->nh_table, &tmp_n, zl3vni_nh_alloc);
 
@@ -1672,7 +1672,7 @@ struct zebra_l3vni *zl3vni_lookup(vni_t vni)
        struct zebra_l3vni tmp_l3vni;
        struct zebra_l3vni *zl3vni = NULL;
 
-       memset(&tmp_l3vni, 0, sizeof(struct zebra_l3vni));
+       memset(&tmp_l3vni, 0, sizeof(tmp_l3vni));
        tmp_l3vni.vni = vni;
        zl3vni = hash_lookup(zrouter.l3vni_table, &tmp_l3vni);
 
@@ -1687,7 +1687,7 @@ static struct zebra_l3vni *zl3vni_add(vni_t vni, vrf_id_t vrf_id)
        struct zebra_l3vni tmp_zl3vni;
        struct zebra_l3vni *zl3vni = NULL;
 
-       memset(&tmp_zl3vni, 0, sizeof(struct zebra_l3vni));
+       memset(&tmp_zl3vni, 0, sizeof(tmp_zl3vni));
        tmp_zl3vni.vni = vni;
 
        zl3vni = hash_get(zrouter.l3vni_table, &tmp_zl3vni, zl3vni_alloc);
@@ -1988,7 +1988,7 @@ static int zl3vni_send_add_to_client(struct zebra_l3vni *zl3vni)
        assert(zvrf);
 
        /* get the svi and vrr rmac values */
-       memset(&svi_rmac, 0, sizeof(struct ethaddr));
+       memset(&svi_rmac, 0, sizeof(svi_rmac));
        zl3vni_get_svi_rmac(zl3vni, &svi_rmac);
        zl3vni_get_vrr_rmac(zl3vni, &vrr_rmac);
 
@@ -2276,7 +2276,7 @@ void zebra_vxlan_evpn_vrf_route_add(vrf_id_t vrf_id, const struct ethaddr *rmac,
         * address. Rmac is programmed against the ipv4 vtep because we only
         * support ipv4 tunnels in the h/w right now
         */
-       memset(&ipv4_vtep, 0, sizeof(struct ipaddr));
+       memset(&ipv4_vtep, 0, sizeof(ipv4_vtep));
        ipv4_vtep.ipa_type = IPADDR_V4;
        if (vtep_ip->ipa_type == IPADDR_V6)
                ipv4_mapped_ipv6_to_ipv4(&vtep_ip->ipaddr_v6,
@@ -2386,7 +2386,7 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
        if (use_json)
                json = json_object_new_object();
 
-       memset(&wctx, 0, sizeof(struct rmac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.vty = vty;
        wctx.json = json;
        if (!use_json) {
@@ -2637,7 +2637,7 @@ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
         * size, we try to be a bit more elegant in display by first computing
         * the maximum width.
         */
-       memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.addr_width = 15;
@@ -2781,7 +2781,7 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
        if (use_json)
                json = json_object_new_object();
 
-       memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.addr_width = 15;
@@ -2834,7 +2834,7 @@ void zebra_vxlan_print_neigh_vni_dad(struct vty *vty,
         * size, we try to be a bit more elegant in display by first computing
         * the maximum width.
         */
-       memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.addr_width = 15;
@@ -2890,7 +2890,7 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
                json_mac = json_object_new_object();
        }
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.json = json_mac;
@@ -2931,7 +2931,7 @@ void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
        if (use_json)
                json = json_object_new_object();
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.vty = vty;
        wctx.json = json;
        wctx.print_dup = print_dup;
@@ -2959,7 +2959,7 @@ void zebra_vxlan_print_macs_all_vni_detail(struct vty *vty,
        if (use_json)
                json = json_object_new_object();
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.vty = vty;
        wctx.json = json;
        wctx.print_dup = print_dup;
@@ -2986,7 +2986,7 @@ void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty,
        if (use_json)
                json = json_object_new_object();
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.vty = vty;
        wctx.flags = SHOW_REMOTE_MAC_FROM_VTEP;
        wctx.r_vtep_ip = vtep_ip;
@@ -3071,7 +3071,7 @@ void zebra_vxlan_print_macs_vni_dad(struct vty *vty,
                json_mac = json_object_new_object();
        }
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.json = json_mac;
@@ -3320,7 +3320,7 @@ static void zevpn_clear_dup_detect_hash_vni_all(struct hash_bucket *bucket,
        zvrf = (struct zebra_vrf *)args[0];
 
        if (hashcount(zevpn->neigh_table)) {
-               memset(&n_wctx, 0, sizeof(struct neigh_walk_ctx));
+               memset(&n_wctx, 0, sizeof(n_wctx));
                n_wctx.zevpn = zevpn;
                n_wctx.zvrf = zvrf;
                hash_iterate(zevpn->neigh_table,
@@ -3328,7 +3328,7 @@ static void zevpn_clear_dup_detect_hash_vni_all(struct hash_bucket *bucket,
        }
 
        if (num_valid_macs(zevpn)) {
-               memset(&m_wctx, 0, sizeof(struct mac_walk_ctx));
+               memset(&m_wctx, 0, sizeof(m_wctx));
                m_wctx.zevpn = zevpn;
                m_wctx.zvrf = zvrf;
                hash_iterate(zevpn->mac_table, zevpn_clear_dup_mac_hash, &m_wctx);
@@ -3368,7 +3368,7 @@ int zebra_vxlan_clear_dup_detect_vni(struct zebra_vrf *zvrf, vni_t vni)
        }
 
        if (hashcount(zevpn->neigh_table)) {
-               memset(&n_wctx, 0, sizeof(struct neigh_walk_ctx));
+               memset(&n_wctx, 0, sizeof(n_wctx));
                n_wctx.zevpn = zevpn;
                n_wctx.zvrf = zvrf;
                hash_iterate(zevpn->neigh_table,
@@ -3376,7 +3376,7 @@ int zebra_vxlan_clear_dup_detect_vni(struct zebra_vrf *zvrf, vni_t vni)
        }
 
        if (num_valid_macs(zevpn)) {
-               memset(&m_wctx, 0, sizeof(struct mac_walk_ctx));
+               memset(&m_wctx, 0, sizeof(m_wctx));
                m_wctx.zevpn = zevpn;
                m_wctx.zvrf = zvrf;
                hash_iterate(zevpn->mac_table, zevpn_clear_dup_mac_hash, &m_wctx);
@@ -3417,7 +3417,7 @@ void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
                json_mac = json_object_new_object();
        }
 
-       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       memset(&wctx, 0, sizeof(wctx));
        wctx.zevpn = zevpn;
        wctx.vty = vty;
        wctx.flags = SHOW_REMOTE_MAC_FROM_VTEP;
@@ -4467,8 +4467,8 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, const struct prefix *p,
        struct ethaddr macaddr;
        struct zebra_evpn *zevpn = NULL;
 
-       memset(&ip, 0, sizeof(struct ipaddr));
-       memset(&macaddr, 0, sizeof(struct ethaddr));
+       memset(&ip, 0, sizeof(ip));
+       memset(&macaddr, 0, sizeof(macaddr));
 
        /* Check if EVPN is enabled. */
        if (!is_evpn_enabled())
@@ -4683,7 +4683,7 @@ int zebra_vxlan_svi_up(struct interface *ifp, struct interface *link_if)
                        zebra_evpn_send_add_to_client(zevpn);
 
                /* Install any remote neighbors for this VNI. */
-               memset(&n_wctx, 0, sizeof(struct neigh_walk_ctx));
+               memset(&n_wctx, 0, sizeof(n_wctx));
                n_wctx.zevpn = zevpn;
                hash_iterate(zevpn->neigh_table, zebra_evpn_install_neigh_hash,
                             &n_wctx);
@@ -5153,12 +5153,12 @@ int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags)
 
                        zebra_evpn_read_mac_neigh(zevpn, ifp);
 
-                       memset(&m_wctx, 0, sizeof(struct mac_walk_ctx));
+                       memset(&m_wctx, 0, sizeof(m_wctx));
                        m_wctx.zevpn = zevpn;
                        hash_iterate(zevpn->mac_table,
                                     zebra_evpn_install_mac_hash, &m_wctx);
 
-                       memset(&n_wctx, 0, sizeof(struct neigh_walk_ctx));
+                       memset(&n_wctx, 0, sizeof(n_wctx));
                        n_wctx.zevpn = zevpn;
                        hash_iterate(zevpn->neigh_table,
                                     zebra_evpn_install_neigh_hash, &n_wctx);