diff options
author | Eneas U de Queiroz <cote2004-github@yahoo.com> | 2018-12-14 16:25:27 -0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2019-07-23 19:29:54 +0200 |
commit | 65a405382bc7457c9425ac88e4e10890eb1284bf (patch) | |
tree | c291e18d31d7d2c31f57a4adad5e66159590131d /package/network/services | |
parent | a68be42f9975d6e1b3f61bee214ab50ceebe1a87 (diff) | |
download | upstream-65a405382bc7457c9425ac88e4e10890eb1284bf.tar.gz upstream-65a405382bc7457c9425ac88e4e10890eb1284bf.tar.bz2 upstream-65a405382bc7457c9425ac88e4e10890eb1284bf.zip |
omcproxy: fix compilation on little-endian CPUs
Don't use cpu_to_be32 outside of a function.
In file included from /omcproxy-2017-02-14-1fe6f48f/src/omcproxy.h:51:0,
from omcproxy-2017-02-14-1fe6f48f/src/mrib.c:39:
omcproxy-2017-02-14-1fe6f48f/src/mrib.c:57:34: error: braced-group within expression allowed only inside a function
static uint32_t ipv4_rtr_alert = cpu_to_be32(0x94040000);
^
cc1: warning: unrecognized command line option '-Wno-gnu'
Ref: https://downloads.openwrt.org/releases/faillogs-18.06/arm_cortex-a9_vfpv3/base/omcproxy/compile.txt
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
[more verbose commit message]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit cb4d00d1841ef6269114f2bd3880800dbdfba3b1)
Diffstat (limited to 'package/network/services')
-rw-r--r-- | package/network/services/omcproxy/Makefile | 2 | ||||
-rw-r--r-- | package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/package/network/services/omcproxy/Makefile b/package/network/services/omcproxy/Makefile index 28de833a1c..e121fa0b23 100644 --- a/package/network/services/omcproxy/Makefile +++ b/package/network/services/omcproxy/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omcproxy -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE_URL:=https://github.com/sbyx/omcproxy.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch b/package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch new file mode 100644 index 0000000000..d71315b60e --- /dev/null +++ b/package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch @@ -0,0 +1,35 @@ +From 721064f2eb1dabe5bda63dcaff249b73ab891e6c Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz <cote2004-github@yahoo.com> +Date: Fri, 14 Dec 2018 15:13:41 -0200 +Subject: [PATCH] mrib.c: don't use cpu_to_be32 outside of function + +cpu_to_be32 is not a constant, so it can't be used outside of a +function. + +Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com> + +--- a/src/mrib.c ++++ b/src/mrib.c +@@ -21,6 +21,7 @@ + #include <stdio.h> + #include <string.h> + #include <stdlib.h> ++#include <endian.h> + #include <sys/socket.h> + #include <sys/ioctl.h> + #include <unistd.h> +@@ -54,7 +55,13 @@ struct mrib_iface { + struct uloop_timeout timer; + }; + +-static uint32_t ipv4_rtr_alert = cpu_to_be32(0x94040000); ++/* we can't use cpu_to_be32 outside a function */ ++#if __BYTE_ORDER == __BIG_ENDIAN ++static uint32_t ipv4_rtr_alert = 0x94040000; ++#else ++static uint32_t ipv4_rtr_alert = 0x00000494; ++#endif ++ + static struct { + struct ip6_hbh hdr; + struct ip6_opt_router rt; |