Alpine linux musl libc bugfixes

This commit is contained in:
Yann Weber 2018-06-30 11:01:47 +02:00
commit dd43556d0b
7 changed files with 23 additions and 7 deletions

View file

@ -58,9 +58,13 @@ For Archlinux, Try this.
sudo pacman -S zlib gmp lib32-gmp openssl lib32-openssl libgee pth libgcrypt autoconf cmake autogen gawk scons git sudo pacman -S zlib gmp lib32-gmp openssl lib32-openssl libgee pth libgcrypt autoconf cmake autogen gawk scons git
For AlpineLinux Try this. For AlpineLinux, Try this.
apk add scons libssl1.0 openssl libgee gmp gmp-dev libgcrypt gawk zlib zlib-dev gcc pkgconf pkgconfig libc-dev libressl-dev libexecinfo-dev linux-headers apk add scons libssl1.0 openssl libgee gmp gmp-dev libgcrypt gawk zlib zlib-dev gcc pkgconf pkgconfig libc-dev libressl-dev libexecinfo-dev linux-headers python
For Debian, Try this.
apt-get install build-essential scons libgcrypt20-dev libssl1.0-dev libgmp-dev zlib1g-dev
To compile the code you can do this: To compile the code you can do this:

View file

@ -22,7 +22,7 @@ opts.AddVariables(('CONF_DIR', """Directory where the Netsukuku configuration fi
opts.Add('CC', 'The C compiler.') opts.Add('CC', 'The C compiler.')
opts.Add('CXX', 'The C++ compiler.') opts.Add('CXX', 'The C++ compiler.')
env = Environment(options = opts, ENV = os.environ, CCFLAGS = ' -Wall') env = Environment(options = opts, ENV = os.environ, CCFLAGS = ['-Wall', '-ggdb'])
env['platform'] = _platform.system().lower(); env['platform'] = _platform.system().lower();
env["CC"] = os.getenv("CC") or env["CC"] env["CC"] = os.getenv("CC") or env["CC"]

View file

@ -108,6 +108,9 @@ if not os.path.exists("config.log") and not env.GetOption('clean'):
Execute(Delete('config.log')) Execute(Delete('config.log'))
Exit(1) Exit(1)
if conf.CheckCHeader(["net/if.h", "netinet/in.h"]):
env.Append(CCFLAGS = ['-DHAVE_NET_IF_H'])
env = conf.Finish() env = conf.Finish()
def conf_build(target, source, env): def conf_build(target, source, env):

View file

@ -7,7 +7,7 @@
#include <limits.h> #include <limits.h>
#if defined(__GLIBC__) && __GLIBC__ == 2 #ifdef HAVE_NET_IF_H
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <netinet/udp.h> #include <netinet/udp.h>

View file

@ -77,7 +77,7 @@ inet_mode (char *domain)
char *ret; char *ret;
char *ret1; char *ret1;
char new_domain[MAXNAMLEN]; char new_domain[NAME_MAX];
int rt_value; int rt_value;
strcpy (new_domain, domain); strcpy (new_domain, domain);
@ -141,7 +141,7 @@ ntk_mode (char *domain)
char *ret; char *ret;
char *ret1; char *ret1;
char new_domain[MAXNAMLEN]; char new_domain[NAME_MAX];
int rt_value; int rt_value;
strcpy (new_domain, domain); strcpy (new_domain, domain);
@ -197,7 +197,7 @@ ntk_mode (char *domain)
domain_ip_processing (char *domain) domain_ip_processing (char *domain)
{ {
char *ret; char *ret;
char new_domain[MAXNAMLEN]; char new_domain[NAME_MAX];
int rt_value; int rt_value;
int i; int i;
ret = strstr (domain, ".inet"); ret = strstr (domain, ".inet");

View file

@ -340,7 +340,11 @@ opts_set_question(char *arg)
ntkresolv_safe_exit(1); ntkresolv_safe_exit(1);
} }
G_ALIGN(16); G_ALIGN(16);
#ifdef HAVE_NET_IF_H
memcpy(GQT->qstdata, &i6a.__in6_union, 16);
#else
memcpy(GQT->qstdata, &i6a.__in6_u, 16); memcpy(GQT->qstdata, &i6a.__in6_u, 16);
#endif
GQT->ipv = ANDNS_IPV6; GQT->ipv = ANDNS_IPV6;
return; return;
case QTYPE_G: case QTYPE_G:
@ -424,7 +428,11 @@ ip_bin_to_str(void *data, char *dst)
via = (void *) (&ia); via = (void *) (&ia);
break; break;
case AF_INET6: case AF_INET6:
#ifdef HAVE_NET_IF_H
memcpy(&(i6a.__in6_union), data, 16);
#else
memcpy(&(i6a.__in6_u), data, 16); memcpy(&(i6a.__in6_u), data, 16);
#endif
via = (void *) (&i6a); via = (void *) (&i6a);
break; break;
default: default:

View file

@ -33,6 +33,7 @@
* xzalloc(size_t size) added. * xzalloc(size_t size) added.
\*/ \*/
#include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>