The shadowsocks source uses the name `encrypt` which is already reserved by
the `unistd.h` header. Rename the local `encrypt` and `decrypt` functions to
`crypto_encrypt` and `crypto_decrypt` in order to prevent clashes with the
standard headers.
Fixes the following build error oberserved on the buildbot:
In file included from client.c:19:0:
crypto.h:18:5: error: conflicting types for 'encrypt'
int encrypt(int sockfd, struct link *ln);
^
In file included from .../staging_dir/toolchain-mipsel_mips32_gcc-4.8-linaro_musl-1.1.10/include/fortify/unistd.h:20:0,
from client.c:12:
.../staging_dir/toolchain-mipsel_mips32_gcc-4.8-linaro_musl-1.1.10/include/unistd.h:145:6: note: previous declaration of 'encrypt' was here
void encrypt(char *, int);
^
make[3]: *** [sslocal] Error 1
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
The configure script incorrectly mangles `CFLAGS` by attempting to remove
`-Werror` from it, thus turning `-Werror=format-security` into just
`=format-security` which will cause subsequent autoconf tests to fail.
Patch out the custom `CFLAGS` mangling to fix the build.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Change `sys/signal.h` include to just `signal.h`. The build otherwise fails
due to `-Werror` with the following message:
In file included from rfcnb-io.c:43:0:
.../staging_dir/toolchain-mipsel_mips32_gcc-4.8-linaro_musl-1.1.10/include/sys/signal.h:1:2: error: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Werror=cpp]
#warning redirecting incorrect #include <sys/signal.h> to <signal.h>
^
cc1: all warnings being treated as errors
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
- Ship a `net/ppp_defs.h` replacement header since musl does not provide one
but `pppd/pppd.h` provided by pppd is needing it.
- Add missing `sys/types.h` includes
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Replace the nonstandard `SIGCLD` signal name with the proper `SIGCHLD` spelling
as the `SIGCLD` alias is not provided by musl.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
fixed sed when filtering IP address from nslookup output
because "Server:" block might have multiple address lines.
Thanks to Arjen de Korte
Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Prefer linux/if_ether.h over netinet/if_ether.h if available since the
musl libc if_ether.h header does not allow mixing with kernel headers,
it will result in a struct ethhdr redefinition error.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
- Include `sys/user.h` if `__WORDSIZE` is undefined
- Add `fcntl.h` to `libscc.c` in order to declare `loff_t`
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Let configure include `sys/if_tun.h` when testing for `netinet/if_ether.h`
to detect the Kernel/libc header conflict on musl.
After this patch, configure will correctly detect `netinet/if_ether.h` as
unusable and the subsequent compilation will not attempt to use it.
Fixes the following compatibility error:
In file included from .../staging_dir/toolchain-mips_mips32_gcc-4.8-linaro_musl-1.1.9/include/linux/if_tun.h:20:0,
from linux/device.c:24:
.../staging_dir/toolchain-mips_mips32_gcc-4.8-linaro_musl-1.1.9/include/linux/if_ether.h:137:8: error: redefinition of 'struct ethhdr'
struct ethhdr {
^
In file included from .../staging_dir/toolchain-mips_mips32_gcc-4.8-linaro_musl-1.1.9/include/net/ethernet.h:10:0,
from linux/../have.h:180,
from linux/../system.h:26,
from linux/device.c:21:
.../staging_dir/toolchain-mips_mips32_gcc-4.8-linaro_musl-1.1.9/include/netinet/if_ether.h:96:8: note: originally defined here
struct ethhdr {
^
make[5]: *** [linux/device.o] Error 1
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Switch the mtr package to the upstream `newdns` git branch.
This will fix compilation on Glibc, uClibc and musl without requiring
further patches.
Note that the base version of this branch is 0.85, not 0.86 so the
lower version number is intentional.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
- Avoid non-pointer use of `FILE` type since its just a forward declaration
- Build with -D_GNU_SOURCE to expose required `struct tcphdr` members
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
- Add missing `sys/ttydefaults.h` include to `config.c`
- Restrict usage of `error.h` to glibc and uclibc only
- Avoid including `linux/if_tun.h` on non-glibc/uclibc to prevent
musl kernel/libc header conflicts
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Pass HAVE_RLIM_T via TARGET_CPPFLAGS since configure uses that define
but never actually declares it.
Without doing that, `config.h` tries to declare `rlim_t` itself which
leads to `config.h:126:16: error: 'long long long' is too long for GCC`
with musl on at least x86_64.
Also refresh patches while we're at it.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
sqm-scripts for a long time interprets a "Down- or Upload speed" of zero as
an indication that the shaper should be disabled. Note that really shaping
an individual direction down o zero will make the link effectively dead
for tcp (think reverse ACK traffic). Son instead of allowing the user to
configure something broken, 0 was "over-loaded" to denote no shaping
since several years, but that information has not been documented visibly
to the users. This commit aims at fixing that oversight.
Signed-off-by: Sebastian Moeller <moeller0@gmx.de>
- Ship a net/ppp_defs.h replacement header since musl does not provide one
but pppd/pppd.h provided by pppd is needing it.
- Replace deprecated MSG_TRYHARD flag with the proper MSG_DONTROUTE one
- Unconditionally include string.h in bcrelay to avoid undeclared memset()
and strcpy() warnings.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Make vsftpd to compile with musl, while preserving uclibc compatibility.
When using musl:
* disable UTMPX functionality
* disable -lnsl option in upstream Makefile
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Add missing includes to libbridge.h to define struct timeval and the
required u_int*_t types under musl.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Do not include netinet/if_ether.h for musl to prevent struct ethhdr
redeclarations.
Also define NETDB_INTERNAL if needed to fix compilation of the network
backends.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>