summaryrefslogtreecommitdiff
path: root/libc/inet
AgeCommit message (Collapse)Author
2014-12-10mkostemp: fix implementationAnthony G. Basile
mkostemp(char *template, int flags) generates a unique temporary filename from a template. The flags parameter accepts three of the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC. The current implementation of mkostemp(3) does not respect the flags and in fact confuses the flags with the file mode which should always be S_IRUSR | S_IWUSR. This patch corrects this issue. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-16buildsys: fix IS_IN_lib*Bernhard Reutner-Fischer
define NOT_IN_libc / IS_IN_libxxx appropriately to fix pthread_once Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18unbreak networking code for sparcWaldemar Brodkorb
This commit 1e2e4ac6193ffe0900bd392fa3c596883771eb34 breaks networking on sparc systems. In Linux the socket functions are declared, but not implemented and must be routed through socketcall(). Tested via Qemu 2.0.0. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-23resolv: try next server on SERVFAILMichel Stam
Commit e1420eca7374cd8f583e9d774c890645a205aaee fixed a bug where a response code should mean the next server is tried. However, it tries only the next search domain, and never skips to the next server. This fix makes sure we try the next server on SERVFAIL. Signed-off-by: Michel Stam <michel@reverze.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-12-20inet: Fix threaded res_initKenneth Soerensen
In a multi-threaded application where res_init() was called either directly or implicitly, getaddrinfo() and others failed to add the DNS search domain to hostnames. This problem made it not possible to look up a hostname without its domain appended. The problem is caused by res_sync_func() overwriting the configuration read by __open_nameservers() immediately after it is read. The suggested solutin is to disable res_sync_func() while reading name server configuration in res_init(). Signed-off-by: Kenneth Soerensen <kenneth.sorensen@spectralink.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-12Make res_init() thread safe.Kenneth Soerensen
res_init() was not atomic, which could give undesired behaviour. Now res_init() is completely locked under one lock and the locking is removed from __res_vinit(). Signed-off-by: Kenneth Soerensen <kenneth.sorensen@spectralink.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-12Fix threaded use of res_ functions.Sørensen, Kenneth
Commit aab4df0fb51660300559f5f29290709db2f7bfee says that the line with after res_init() function. Commit 7f74de5d4d6d10baafab4b37bb3d472f5c5f0e8c moves the res_init() function below the line with #undef _res. This commit moves res_init() back above #undef _res. Signed-off-by: Kenneth Soerensen <kenneth.sorensen@spectralink.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-10-07pmap_getport: use TCP to talk to portmapper if protocol == IPPROTO_TCP.Denys Vlasenko
Before the patch, the query itself was sent via UDP (the query contained correct protocol ID). The fix is taken from glibc. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-19inet: fix unsafe access to _res.options in res_mkquery()Vanya Sergeev
res_mkquery() takes out __resolv_lock to copy _res.options to function local _res_options on line 4204, but later unsafely accesses _res.options without a lock, instead of its local copy _res_options, on line 4221. Looks like a period / underscore typo. Signed-off-by: Vanya Sergeev <vsergeev@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-29inet: fix getting the nameserver from _res state after res_init.Felix Fietkau
Fixes displaying the nameserver in busybox nslookup. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-20inet: do not filter responses in res_queryTimo Teräs
Fixes bug #5342 res_query was silently rejecting responses against T_ANY DNS questions. Remove the type-filtering from res_query altogether. __dns_lookup is supposed to return the proper stuff that you asked for (and only that). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-20inet: Fix LT{.old,} compilation due to res_icloseBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-20rpc: silence warningBernhard Reutner-Fischer
Silence warning about shadowing wait Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-14inet: res_nclose: free user-buffer, not global _resBernhard Reutner-Fischer
In res_iclose we were operating on the global _res even if called via res_nclose where we are supposed to operate on the user provided res_state. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-20inet: remove noreturn attribute from res_ncloseBernhard Reutner-Fischer
Partially revert e9af4dfbd328e9f3bba235fdb2d1027dd2dbbcde Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-07buildsys: Fix kbuild-style switch falloutMarkos Chandras
regressions introduced in 1b3025b7352f5e432ffa1c7adc57085ac9092b77 "buildsys: switch libc to kbuild-style" unistd: Handle !UCLIBC_HAS_GET{, SUB}OPT cases libc/libc_so.a(getsubopt-susv3.os): In function getsubopt': getsubopt-susv3.c:(.text+0x0): multiple definition of getsubopt' libc/libc_so.a(getsubopt.os):getsubopt.c:(.text+0x0): first defined here. The solution is to filter out the correct files when UCLIBC_HAS_GETOPT and UCLIBC_HAS_GETSUBOPT are not defined. inet: Move INET_RPC_{DIR, OUT} before CSRC_ALL libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_max_pollfd': rpc_thread.c:(.text+0x148): undefined reference to svc_max_pollfd' libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_pollfd': rpc_thread.c:(.text+0x184): undefined reference to svc_pollfd' The CSRC_ALL variable uses the INET_RPC_DIR variable which is initialized later on. We fix this problem by moving the INET_RCP_{DIR,OUT} definitions before we use them in CSRC_ALL Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-05buildsys: switch libc to kbuild-styleBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-01-26libc/inet: pull in stddef.h for NULLMike Frysinger
Fixes a build error: In file included from libc/inet/recv.c:8:0: libc/inet/socketcalls.c: In function '__recv_nocancel': libc/inet/socketcalls.c:203:57: error: 'NULL' undeclared (first use in this function) Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-01-17socket.h: pull socket_type.h from eglibcBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-04libc/inet/resolv.c: Use IE model for TLS data.Will Newton
All other TLS data in uClibc is explicitly using the IE model, so use it for __resp too. This generates smaller and faster code. Signed-off-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-08-04libc/inet/resolv.c: Remove obsolete comment.Will Newton
The definition of __resp has been hidden for some years (commit 22de495d). Remove the comment suggesting that it is not. Signed-off-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15signal: remove sigblock, siggetmask and sigsetmaskPeter S. Mazinger
rcmd.c uses sigblock and sigsetmask, make the function static and include them directly until a rewrite is done. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15socketcalls.c: rewrite to use cancel.hPeter S. Mazinger
__socketcall.c: remove guard, we definitely need this syscall Re-added guard plus added comment (Bernhard) Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15resolv.c: shrink code a bit in getnameinfo.Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15addr.c: get rid of a compiler warningPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15socketcalls.c: prefer using recvfrom in recv and sendto in sendPeter S. Mazinger
Make socketcall the last alternative. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15fix a bunch of build warningsPeter S. Mazinger
Added attribute_noreturn even if it has return at the end of function Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15resolv.c,time.c,_atexit.c: hide 3 locksPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15pm_getport.c: s/__close/close/Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15resolv.c: include param.h and use MIN instead of minPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15sa_len.c: do not include ipx.h, the IPX code is disabledPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15getaddrinfo.c: replace #if SALEN with #if 0Peter S. Mazinger
make it clear, that the code is disabled Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15rpc: constify some more dataPeter S. Mazinger
Comments in header were used by vda on a similar commit Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15clnt_generic.c: whitespace only, no code changePeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15pm_getmaps.c: change __close to close (even though unused)Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15ruserpass.c: needs stdio_ext.h only if threads are enabledPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15rcmd.c: no need for stdio_ext.hPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15xdr_intXX_t.c,xdr.h: add xdr_quad_t and xdr_u_quad_tPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15svc_auth.c: use same prototypes as in svc_authux.cPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15pmap_rmt.c: do not undefine _POSIX_SOURCE, it is anyway too latePeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15rpc: remove unused USE_IN_LIBIO guarded codePeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15resolv.c: remove duplicated attribute_hiddenPeter S. Mazinger
while there add one for future (currently in unused code) Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15ntohl.c: simplify and shrink ntohl and friendsPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15libintl.h, clnt_perror.c: add fallback gettext(x) and use it for _(x)Peter S. Mazinger
clnt_perror.c: change _(x) to N_(x) to allow compile with the change in libintl.h Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15libintl.h: add _(x) and N_(x) and use it everywherePeter S. Mazinger
remove _LIBC part from rpc headers include libintl.h to rpc_private.h and use that instead of rpc.h include libintl.h anywhere else needed replacing _(x) and N_(x) Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15use one common prototype for _create_xidPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15rpc_private.h: change guardPeter S. Mazinger
need another guard, else rpc/rpc.h might not be included Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15remove __FORCE_GLIBCPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15do not include libc-internal.hPeter S. Mazinger
it is already included by features.h Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>