diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 12:16:44 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 13:08:47 +0200 |
commit | 6006b807b1a84d31611173b837fafcd96ba9d692 (patch) | |
tree | 08f25453328d8c408f1a8c658e4e6ef91005d4a7 /zebra/rtadv.c | |
parent | ripd: Use correct usage of memcpy() when zeroing struct (diff) | |
download | frr-6006b807b1a84d31611173b837fafcd96ba9d692.tar.xz frr-6006b807b1a84d31611173b837fafcd96ba9d692.zip |
*: Properly use memset() when zeroing
Wrong: memset(&a, 0, sizeof(struct ...));
Good: memset(&a, 0, sizeof(a));
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'zebra/rtadv.c')
-rw-r--r-- | zebra/rtadv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c index ca833999c..e1d2016e6 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -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; |