OpenWrt Forum Archive

Topic: Error cross compiling redsocks with OpenWrt SDK

The content of this topic has been archived on 13 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

utils.c: In function 'red_recv_udp_pkt':
utils.c:58:24: error: 'IP_ORIGDSTADDR' undeclared (first use in this function)
utils.c:58:24: note: each undeclared identifier is reported only once for each function it appears in


utils.c: In function 'red_recv_udp_pkt':
utils.c:58:24: error: 'IP_ORIGDSTADDR' undeclared (first use in this function)
utils.c:58:24: note: each undeclared identifier is reported only once for each function it appears in


misuzi@ubuntu:~/openwrt/trunk/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33.2/include$ grep IP_ORIGDSTADDR netinet/in.h
misuzi@ubuntu:~/openwrt/trunk/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33.2/include$

Seems IP_ORIGDSTADDR could be found under TOOLCHAIN_DIR/include/linux/in.h . How could I solve that?

Find out its correct value and #define it within your source file, something like:

#ifndef IP_ORIGDSTADDR
#define IP_ORIGDSTADDR 20
#endef

If you're too lazy to patch or edit the sources, then pass it via the compiler command line:

gcc ... -DIP_ORIGDSTADDR=20 ...

Thx,I will try it first smile

really works, thx a lot.

Any chance you could put the compiled packages somewhere? I've had no luck with transocks and this would really help me avoid duplicating effort.

Thanks!

Nevermind, I wasn't paying attention to architecture -- I'm looking for ar71xx. Thanks anyway!

(Last edited by hjbotha on 29 Jul 2012, 19:35)

The discussion might have continued from here.