Use struct initialization and drop memset. We do not need to set the port
ID, since the kernel will do it for us.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
{
int status;
int group = GROUP;
- struct sockaddr_nl local_addr;
+ struct sockaddr_nl local_addr = {.nl_family = AF_NETLINK};
int sock_fd, buf_size;
unsigned char *buf;
return 1;
}
- memset(&local_addr, 0, sizeof(local_addr));
- local_addr.nl_family = AF_NETLINK;
- local_addr.nl_pid = getpid();
local_addr.nl_groups = group;
status = bind(sock_fd, (struct sockaddr *)&local_addr, sizeof(local_addr));
if (status == -1) {