From 63159d3f872e99620766e0a6f0b7e6546d669410 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 9 Dec 2024 15:40:48 +0100 Subject: [PATCH] sockaddr_in no memset --- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index 303ceb041c..0de8843847 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -460,10 +460,7 @@ static uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr) int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t len) { // todo : consider how to do this only once - struct sockaddr_in remote_addr; - memset((char*)&remote_addr, 0, sizeof(struct sockaddr_in)); - remote_addr.sin_family = AF_INET; - remote_addr.sin_port = htons(pnf_p7->_public.remote_p7_port); + struct sockaddr_in remote_addr = {.sin_family = AF_INET, .sin_port = htons(pnf_p7->_public.remote_p7_port)}; if(inet_aton(pnf_p7->_public.remote_p7_addr, &remote_addr.sin_addr) == -1)