From a9dcf6937ede801effaf64f03470fa838246278b Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Fri, 4 May 2012 22:06:50 +0200 Subject: Fix invalid assignment to const void pointer gcc 4.7 and above ignore such assignments which leads to a broken ipset binary (bug reported by Seblu). --- lib/session.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/session.c b/lib/session.c index 01a2413..6700ea1 100644 --- a/lib/session.c +++ b/lib/session.c @@ -1464,21 +1464,21 @@ rawdata2attr(struct ipset_session *session, struct nlmsghdr *nlh, return 1; switch (attr->type) { - case MNL_TYPE_NUL_STRING: - alen = strlen((const char *)d) + 1; - break; case MNL_TYPE_U32: { uint32_t value = htonl(*(const uint32_t *)d); - d = &value; - break; + mnl_attr_put(nlh, type | flags, alen, &value); + return 0; } case MNL_TYPE_U16: { uint16_t value = htons(*(const uint16_t *)d); - d = &value; - break; + mnl_attr_put(nlh, type | flags, alen, &value); + return 0; } + case MNL_TYPE_NUL_STRING: + alen = strlen((const char *)d) + 1; + break; default: break; } -- cgit v1.2.3