Skip to content
Permalink
Branch: master
Commits on Jun 27, 2019
  1. posix: unistd.h: Add gethostname()

    pfalcon authored and galak committed Feb 21, 2019
    Per POSIX, gethostname() is declared in unistd.h.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on Jun 5, 2019
  1. net: sockets: Make NET_SOCKETS_POSIX_NAMES depend on !POSIX_API

    pfalcon authored and nashif committed Jun 3, 2019
    These options are mutually exclusive, or more specifically,
    CONFIG_POSIX_API has wider scope and supersedes
    CONFIG_NET_SOCKETS_POSIX_NAMES. Implementation-wise, the two
    options should not be defined at the same time, as that may
    lead to declaration conflicts.
    
    Fixes: #16141
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. include: arch: arc: Minor punctuation fix

    pfalcon authored and nashif committed Jun 4, 2019
    Add missing space after comma.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 29, 2019
  1. tests: net: getaddrinfo: Add cases for numeric IPv4 addr

    pfalcon authored and jukkar committed May 28, 2019
    And also for AI_NUMERICHOST flag.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. net: getaddrinfo: Parse numeric IPv4 addresses

    pfalcon authored and jukkar committed Feb 22, 2019
    If a valid numeric IP address is provided as argument, it should
    be resolved without contacting DNS server.
    
    Also, implement handling of AI_NUMERICHOST.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 27, 2019
  1. ext: mbedtls: Enable easy integration with POSIX API

    pfalcon authored and jukkar committed May 21, 2019
    If CONFIG_POSIX_API is defined, automatically use time() function.
    The alternative to that is to explicitly configure mbedTLS' timing
    source via API, as required for "raw code", but if user enables
    POSIX API, we as well might use existing mbedTLS integration.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 23, 2019
  1. tests: benchmarks: mbedtls: Fix printf args

    pfalcon authored and nashif committed May 23, 2019
    As printf() is now used directly instead of printf proxy function,
    there's warning-as-error that long long is passed where %lu
    expected, so cast it explicitly.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. tests: mbedtls: Call mbedtls_platform_set_printf() only if needed

    pfalcon authored and nashif committed May 23, 2019
    It exists only if MBEDTLS_PLATFORM_PRINTF_ALT is defined, whcih we
    no longer do, but make the call condiitonal in case we'll need to
    make it configurable later.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  3. libc: minimal: Implement exit()/_exit() functions.

    pfalcon authored and nashif committed May 23, 2019
    Behavior is similar to newlib version: print "exit" message and go
    into infinite loop.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  4. ext: mbedtls: Don't define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS

    pfalcon authored and nashif committed May 22, 2019
    That means that when mbedTLS will need functions like snprintf(),
    printf(), a few others, they will be used from libc, as done
    normally by most of software. Note that mentioned functions
    aren't normally used on code paths doing TLS communication per se.
    Instead, they are used by debug logging, additional "print info"
    style functions, etc.
    
    Before, when MBEDTLS_PLATFORM_NO_STD_FUNCTIONS was defined, those
    functions were stubbed out, so silently didn't work as expected
    (a specific symptom seen was that some debug messages were printed
    as garbage, because an buffer on stack was passed to dummy snprintf
    stub, which didn't do anything to it, and its uninitialized contents
    were printed afterwards. Instead, the expectation was that an
    application would call a "setter" function to set snprintf, etc.
    implementations as provided by application itself.
    
    For Zephyr, we clearly don't need to burden applications with such
    setup, instead Zephyr, as an OS, provides integrated environment
    were matters like that "just work". So, we just switch to libc-based
    functions. If there ever will be usecases for
    MBEDTLS_PLATFORM_NO_STD_FUNCTIONS, it can be made configurable later.
    
    Fixes: #16303
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 16, 2019
  1. net: getaddrinfo: Implement initial handling of host == NULL

    pfalcon authored and jukkar committed Feb 22, 2019
    If host is NULL and ai_flags are AI_PASSIVE in a call to
    getaddrinfo(), need to return "any" address.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 11, 2019
  1. samples: google_iot_mqtt: Explicitly cast socklen_t to int in printf

    pfalcon authored and jukkar committed May 10, 2019
    Otherwise, it can lead to warning like:
    
    main.c:80:10: warning: format '%d' expects argument of type 'int',
    but argument 2 has type 'socklen_t' {aka 'long unsigned int'}
    [-Wformat=]
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. samples: google_iot_mqtt: Switch from sntp_request() to sntp_query()

    pfalcon authored and jukkar committed May 10, 2019
    sntp_request() was deprecated and superceded by sntp_query(), which
    provides better time resolution.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  3. samples: sntp_client: Switch from sntp_request() to sntp_query()

    pfalcon authored and jukkar committed May 10, 2019
    sntp_request() was deprecated and superceded by sntp_query(), which
    provides better time resolution.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 10, 2019
  1. net: sntp: Add convenience API for one-shot SNTP query

    pfalcon authored and jukkar committed Apr 22, 2019
    sntp_simple() function queries the server (passed as "addr[:port]"
    string). It wraps calls to a number of other functions, and may be
    useful to write simple, concise apps needing the absolute time.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. net: socketutils: Add utils to manipulate network address strings

    pfalcon authored and jukkar committed Apr 22, 2019
    Two utils to manipulate addresses in format "addr[:port]". I.e.,
    network address (domain name or numeric), optionally followed by
    port number:
    
    * net_addr_str_find_port(), to return pointer to port number
    substring (or NULL if not present).
    * net_getaddrinfo_addr_str(), which is effectively getaddrinfo()
    wrapper taking a "addr[:port]" string as a parameter.
    
    The header file is named socketutils.h to emphasize that these
    utility functions are implemented on top of BSD Sockets API
    (and other POSIX/ANSI C functions), and thus portable to other
    POSIX systems (e.g., Linux), so can be used in apps testing
    POSIX compatibility. More utility functions (beyond address
    manipulation) can be added later.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  3. net: socket: Define NI_MAXHOST for compatibility

    pfalcon authored and jukkar committed May 7, 2019
    Not in POSIX. Linux man getnameinfo says about it:
    
    "In order to assist the programmer in choosing reasonable sizes for
    the supplied buffers, <netdb.h> defines the constants
    
               #define NI_MAXHOST      1025
               #define NI_MAXSERV      32
    
    Since glibc 2.8, these definitions are exposed only if suitable
    feature test macros are defined, namely: _GNU_SOURCE, _DEFAULT_SOURCE
    (since glibc 2.19), or (in glibc versions up to and including 2.19)
    _BSD_SOURCE or _SVID_SOURCE."
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 8, 2019
  1. CODEOWNERS: Add entry for lib/libc

    pfalcon authored and nashif committed Apr 24, 2019
    Add fallback maintainer for lib/libc.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. posix: sys/time.h: Add workaround for outdated newlib used by Xtensa

    pfalcon authored and nashif committed Apr 24, 2019
    Unfortunately, Zephyr SDK 0.10.0 ships with outdate Newlib 2.0.0
    (from 2015 or earlier) which lacks sys/_timeval.h header, requiring
    ugly workaround of defining struct timeval inline (the whole idea
    was to standardize on sys/_timeval.h header for different libc's).
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  3. posix: Move gettimeofday declaration to <sys/time.h>

    pfalcon authored and nashif committed Apr 23, 2019
    According to POSIX, that's the header which defines this function.
    Similarly, nothing in POSIX indicates that <time.h> should have
    access to struct timeval, so it's removed (it's made accessible
    to <sys/time.h> via <sys/_timeval.h> introduced earlier).
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  4. libc: minimal: Introduce sys/_timeval.h

    pfalcon authored and nashif committed Apr 23, 2019
    This is implementation-level header which defines struct timeval, and
    intended to be included by headers which need this structure. This
    implementation scheme is compatible with Newlib, and thus provides a
    step to use minlibc vs Newlib interchangeably.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  5. libc: minimal: Define time_t and suseconds_t

    pfalcon authored and nashif committed Apr 23, 2019
    According to POSIX, these types should be defined by sys/types.h.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on May 7, 2019
  1. tests: socket: misc: Add tests for inet_pton()

    pfalcon authored and jukkar committed May 6, 2019
    Basic testcases for accepting correct input and rejecting invalid.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on Apr 24, 2019
  1. testsuite: Include thread name in crash dump for tests

    pfalcon authored and andrewboie committed Mar 13, 2019
    By selecting CONFIG_THREAD_NAME. It makes sense to have this enabled
    by default for tests, to easy debugging in a case of crash.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. arch: x86: fatal: If possible, print thread name in crash dump

    pfalcon authored and andrewboie committed Mar 7, 2019
    It's relatively hard to figure out what thread a crash happens in
    from the crash dump. E.g, it's usually not immediately possible to
    find it out from linker map due to the fact that static symbols are
    not there (https://sourceware.org/bugzilla/show_bug.cgi?id=16566).
    
    So, try to do it as easy if possible, by just printing thread name
    in a dump, if thread names are enabled at all.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  3. net: sntp: Add sntp_query() function with fractional precision

    pfalcon authored and jukkar committed Apr 22, 2019
    Existing sntp_request() function has a coarse integer seconds
    precision,  discarding fractional part as returned by SNTP.
    Deprecate it, and instead introduce sntp_query() function which
    returns both integer and fractional seconds as a newly introduced
    structure sntp_tstamp.
    
    Fixes: #15596
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  4. samples: sntp_client: Elaborate sample to workable state

    pfalcon authored and jukkar committed Apr 20, 2019
    1. Output what steps the app performs, so it doesn't look to user
    that it simply hanged.
    2. Don't use infinite timeouts, because that will hang.
    3. Clearly note which requests are for IPv4 vs IPv6 server.
    4. Define IPv4 gateway. This sample is configured to run against
    SNTP on local Linux host, but standard distros (e.g. Ubuntu) don't
    run SNTP server by default, so usual outcome for running this sample
    will be timeout. A realistic way to get successful output would be
    to run it against a server on the Internet, for what a gateway is
    required.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  5. net: sntp: Handle case of request timeout

    pfalcon authored and jukkar committed Apr 20, 2019
    Previously, a case when poll() call timed out wasn't handled, and
    recv() was called unconditionally. In the case of timeout, recv()
    itself would hang indefinitely.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on Apr 4, 2019
  1. net: sockets: Add docstrings for BSD Sockets API

    pfalcon authored and galak committed Mar 26, 2019
    The current idea is that we document zsock_* prefixed symbols, refer
    to Open Group POSIX website
    (http://pubs.opengroup.org/onlinepubs/9699919799/) for normative
    descriptions, and explicitly mention bare POSIX name of a function
    too (so e.g. users could find it via search).
    
    Fixes: #13397
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on Mar 26, 2019
  1. net: socket: Define flags for getaddrinfo()

    pfalcon authored and nashif committed Feb 21, 2019
    Add various AI_* flags, similar to previously added flags for
    getnameinfo(). All flags specified by POSIX are defined (with
    values compatible with Linux), to allow to build existing
    software which may refer to them. They can be implemented
    gradually, as usecases arrive.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. samples: sockets: Add e1000 and stellaris ethernet drivers overlays

    pfalcon authored and galak committed Mar 25, 2019
    Add qemu ethernet driver overlays for big_http_download and
    dumb_http_server samples, which are default integration samples/
    tests for TCP stack. This change follows up after similar addition
    of such overlays to other samples (and smsc911x overlay addition
    to these samples).
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on Mar 20, 2019
  1. net: ip: connection: Typo fixes in comment

    pfalcon authored and galak committed Mar 19, 2019
    Fix typos and reword code comment on module dependencies a bit.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commits on Mar 18, 2019
  1. net: pkt: Clarify docstring of the new API

    pfalcon authored and galak committed Mar 6, 2019
    Make descriptions a bit more clear, emphasizing the primary
    operation, and de-emphsizing (but still describing) prerequisites
    and side effects.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  2. net: sockets: recv_stream: Check that the underlying net_context active

    pfalcon authored and galak committed Mar 4, 2019
    It may be closed by the stack behind our back (something which needs
    to be fixed).
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  3. net: context: put: Update for shared TCP context ownership

    pfalcon authored and galak committed Feb 22, 2019
    TCP context is now created with refcount of 2, signifying that it's
    jointly owned by an app and stack. Thus, net_context_put()
    unconditionally calls net_context_unref() to decrement refcount on
    app's behalf, and leaves stack's refcount to internal routines
    which handle sending/receiving/timing out FINs, etc.
    
    Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Older
You can’t perform that action at this time.