diff options
| author | Sharath Ramamurthy <sramamurthy@nvidia.com> | 2021-08-08 11:28:07 +0530 |
|---|---|---|
| committer | Stephen Worley <sworley@nvidia.com> | 2023-02-13 18:12:04 -0500 |
| commit | e8a392d91c879a1d4f877fd69fb9fb52983fd271 (patch) | |
| tree | d56f3999d783c11e5fa426997fdc0025d5858282 | |
| parent | fe44a3696f1fdde3e5e19813f253c03b97be9736 (diff) | |
zebra: fix for issues found during static analysis
This patch addresses fix for issues found during static analysis.
rt_netlink - initialise vtep if there is NDA_DST attribute
if_netlink - initialise vni_start and vni_end
Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
| -rw-r--r-- | zebra/if_netlink.c | 3 | ||||
| -rw-r--r-- | zebra/rt_netlink.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index c097e23777..02b9ab9d7f 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -737,6 +737,9 @@ static int netlink_bridge_vxlan_vlan_vni_map_update(struct interface *ifp, struct zebra_vxlan_vni vni_start; struct rtattr *aftb[IFLA_BRIDGE_VLAN_TUNNEL_MAX + 1]; + memset(&vni_start, 0, sizeof(vni_start)); + memset(&vni_end, 0, sizeof(vni_end)); + for (i = RTA_DATA(af_spec), rem = RTA_PAYLOAD(af_spec); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index f205f297db..d09318a5a5 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -3536,7 +3536,8 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id) IPV4_MAX_BYTELEN); snprintfrr(dst_buf, sizeof(dst_buf), " dst %pI4", &vtep_ip); - } + } else + memset(&vtep_ip, 0, sizeof(vtep_ip)); if (tb[NDA_NH_ID]) nhg_id = *(uint32_t *)RTA_DATA(tb[NDA_NH_ID]); |
