Skip to content

Commit

Permalink
fix compilation with GCC14
Browse files Browse the repository at this point in the history
the msghdr has padding in both glibc and musl. Initialize with names to
avoid dealing with the padding.

There's also a wrong struct type that's an error now.

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb authored and PolynomialDivision committed Jun 9, 2024
1 parent 204a44a commit d72be9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/filtergw/src/olsrd_filtergw.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct originator_list {

struct filter_group {
struct originator_list *originator_list;
struct hna_group *next;
struct filter_group *next;
};

static struct filter_group *filter_groups = NULL;
Expand Down Expand Up @@ -128,7 +128,7 @@ static int set_plugin_filter(const char *value,
olsr_exit("FILTERGW: Out of memory", EXIT_FAILURE);
}
filter_groups = new;
new->next = (struct hna_group *)filter_groups;
new->next = filter_groups;
}

filter_groups->originator_list =
Expand Down
14 changes: 7 additions & 7 deletions src/linux/kernel_routes_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ static void rtnetlink_read(int sock, void *data __attribute__ ((unused)), unsign
struct iovec iov;
struct sockaddr_nl nladdr;
struct msghdr msg = {
&nladdr,
sizeof(nladdr),
&iov,
1,
NULL,
0,
0
.msg_name = &nladdr,
.msg_namelen = sizeof(nladdr),
.msg_iov = &iov,
.msg_iovlen = 1,
.msg_control = NULL,
.msg_controllen = 0,
.msg_flags = 0,
};

char buffer[4096];
Expand Down

0 comments on commit d72be9a

Please sign in to comment.