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 /ospfclient | |
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 'ospfclient')
-rw-r--r-- | ospfclient/ospf_apiclient.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ospfclient/ospf_apiclient.c b/ospfclient/ospf_apiclient.c index 1908604bd..e84c6f5b3 100644 --- a/ospfclient/ospf_apiclient.c +++ b/ospfclient/ospf_apiclient.c @@ -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 |