From 767c54d5957a2db0b847add771e8e890b82569c0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 5 Oct 2014 13:01:12 +0200 Subject: [PATCH] route: fix an error with strict-aliasing Signed-off-by: Felix Fietkau --- route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/route.c b/route.c index 03046ab..5935b82 100644 --- a/route.c +++ b/route.c @@ -94,10 +94,11 @@ rtnl_rule_request(struct relayd_interface *rif, int flags) strcpy(req.dev.ifname, ifname); req.dev.rta.rta_len = sizeof(req.dev.rta) + strlen(ifname) + 1; } else { + uint32_t val = 1; req.dev.rta.rta_type = FRA_PRIORITY; req.dev.rta.rta_len = sizeof(req.dev.rta) + sizeof(uint32_t); padding -= sizeof(uint32_t); - *((uint32_t *) &req.dev.ifname) = 1; + memcpy(&req.dev.ifname, &val, sizeof(val)); } req.table.table = get_route_table(rif); req.nl.nlmsg_len = sizeof(req) - padding; -- 2.25.1