diff options
author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-04-09 16:35:11 +0200 |
---|---|---|
committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-04-09 16:35:11 +0200 |
commit | cc42104c35610bba4c22f89b795aa506c2f28a91 (patch) | |
tree | 2cc8da25ca09ac4c4d81a520e4000c0d6cb4052d /zebra | |
parent | Merge pull request #4095 from pacovn/201904_master__lm_aliasing_fixes (diff) | |
download | frr-cc42104c35610bba4c22f89b795aa506c2f28a91.tar.xz frr-cc42104c35610bba4c22f89b795aa506c2f28a91.zip |
zebra: Fix late memset of pbr rule in rule_netlink
We were memsetting zebra_pbr_rule struct after
we had already put some information in it. Also updated
the init of the struct to use braces instead of a
memset.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/rule_netlink.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/zebra/rule_netlink.c b/zebra/rule_netlink.c index 477549f42..8cc5b52b3 100644 --- a/zebra/rule_netlink.c +++ b/zebra/rule_netlink.c @@ -185,7 +185,7 @@ int netlink_rule_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) struct rtattr *tb[FRA_MAX + 1]; int len; char *ifname; - struct zebra_pbr_rule rule; + struct zebra_pbr_rule rule = {}; char buf1[PREFIX_STRLEN]; char buf2[PREFIX_STRLEN]; @@ -230,7 +230,6 @@ int netlink_rule_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) if (!rule.ifp) return 0; - memset(&rule, 0, sizeof(rule)); if (tb[FRA_PRIORITY]) rule.rule.priority = *(uint32_t *)RTA_DATA(tb[FRA_PRIORITY]); |