eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit f0848cc44a144745d1fa54d4a7ba2d1741a15160
parent 0706a357a4f55767a5b969684abaeccfe29e7486
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Wed, 26 Jun 2019 10:43:38 -0500

rtnlutil: Don't use explicit_bzero

Use memset instead.  explicit_bzero should only be used when we're
wiping a secret just prior to the encopassing storage being freed.  The
compiler would usually optimize away the memset, leaving the secrets
around.

In rtnlutil we're simply zeroing the structure prior to filling it, so
the use of explicit_bzero is not needed and brings confusion to the
reader since no secrets are being wiped.

Diffstat:
Msrc/rtnlutil.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rtnlutil.c b/src/rtnlutil.c @@ -131,7 +131,7 @@ uint32_t rtnl_ifaddr_get(struct l_netlink *rtnl, l_netlink_command_func_t cb, uint32_t id; rtmmsg = l_malloc(sizeof(struct ifaddrmsg)); - explicit_bzero(rtmmsg, sizeof(struct ifaddrmsg)); + memset(rtmmsg, 0, sizeof(struct ifaddrmsg)); rtmmsg->ifa_family = AF_INET; @@ -162,7 +162,7 @@ static uint32_t rtnl_ifaddr_change(struct l_netlink *rtnl, uint16_t nlmsg_type, RTA_SPACE(sizeof(struct in_addr)); rtmmsg = l_malloc(bufsize); - explicit_bzero(rtmmsg, bufsize); + memset(rtmmsg, 0, bufsize); rtmmsg->ifa_index = ifindex; rtmmsg->ifa_family = AF_INET;