Commit c42a5c83 authored by Antonin Décimo's avatar Antonin Décimo Committed by Juliusz Chroboczek

Fix alignment issue.

The original code was taken from netlink's manpage, which is buggy.
The buffer might not be aligned to struct nlmsghdr pointers.
parent 0835d5d8
...@@ -315,7 +315,7 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer, ...@@ -315,7 +315,7 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer,
int done = 0; int done = 0;
int skip = 0; int skip = 0;
char buf[8192]; struct nlmsghdr buf[8192/sizeof(struct nlmsghdr)];
memset(&nladdr, 0, sizeof(nladdr)); memset(&nladdr, 0, sizeof(nladdr));
nladdr.nl_family = AF_NETLINK; nladdr.nl_family = AF_NETLINK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment