Some samples were including nullsec.c, simplerdc.c and
framer-nullmac.c, those files are not needed but introduce some
symbol dependencies, causing link to fail when optimization is not
-Os, e.g. when compiling with CONFIG_DEBUG.
Change-Id: Id227470a4517e8e2c3b9af942b0893783075cd40
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
This commit only provides the Trickle algorithm support.
Some other entity must call its functions in order to be
useful.
Fixes: ZEP-627
Change-Id: Ice1fcfe9c57269309eeab06eab000622662e2929
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
tcpip_poll_tcp() was changed with commit 61edc68c to take on a
data_buf parameter, which was then processed as the primary
buffer. That change led to incorrect behaviour where the handling
of the first data buffer on a connection got mixed with the SYN buf.
It is no longer clear why tcpip_poll_tcp() was modified with the
change 61edc68c originally. Reverting the modification to
tcpip_poll_tcp() leads to much better handling of TCP data; and
also obviates another pull-request submitted recently:
https://gerrit.zephyrproject.org/r/#/c/4226.
Change-Id: I947c0991495c538c41e6581c8d360526b1bb89ad
Signed-off-by: Rohit Grover <rohit.grover@arm.com>
Adjust the data pointer passed to a udp_socket_register() registered
callback to point to the udp data contents rather than the header
information.
Change-Id: Ib90eee91e0ec4d0290517fee7b929d39ce3e07c6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
If retries are 0 (which should never be), ret will not be initialized.
Change-Id: I8ef9a2ccbf89191e48d407fdb1292554fa8f15d9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The uip stack processes received packets by calling net_recv() but
does not discard packets marked with an ethertype other than IPv4 or
IPv6 resulting in confusion further up the stack. Discard non IPv4/v6
packets from further processing by the IP stack.
Change-Id: Ic62f8d12b02da197b1abc774a581bff30330080c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
This will lead to conflicts and warning coming from Kconfig, so just
whitelist the board in the samples where this hardware is supported
Jira: ZEP-739
Change-Id: I4a2f3bdcfdb44fc75df0e272c237789ee16e0de1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Kconfig allows selecting NETWORKING_WITH_15_4_TI_CC2520 even if the
current board doesn't support it, and also selects it by default. This
breaks building the 15.4 sample with qemu_x86. Add a config option for
having CC2520 support and enable the choise only if it is available.
In addition, remove unused function from iee802154 code, as it now
fails the tests.
Jira: ZEP-697
Change-Id: Ib082f82acdd0f86d3306bbd3bb827f61b0fd0be1
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
The eventhandler gets called with NULL buf, but it can't handle it. Add
a NULL check to prevent crashing.
Change-Id: Id16c2aa093a145e0442dfc61dd0b6e1b81b701f5
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
etimer_expired will return true only once. This means periodic timers in
the netstack won't get to run since etimer_process calls etimer_expired
for all timers in the stack.
Jira: ZEP-475
Change-Id: I28da638789b0604f9dd0a0598a7fa590e6b0a746
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
the traverse step length should be sizeof(struct uip_udp_conn)
in uip_process when matching the right uip_udp_conn for net_buf
Change-Id: I33c0499582a96e5031ba94f147ff2376726b3f9c
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
net_context_get will obtain ip addr from uip_hostaddr when the local
ipv4 addr is set to INADDR_ANY. So local_addr->in_addr.s_addr[0] is
represented for the local ipv4 addr content.
Change-Id: Ie6d77f27bdde5ea8568428a61b129eccb253df0a
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
The function is getting called with NULL bufs, so uip_len cannot be
called on them. The stack further down handles NULL buffers correctly.
Jira: ZEP-474
Change-Id: I85fb045ec76bea2a83c64d0f72eabba4e661f5f4
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
When first starting the board, uip_connr may be NULL. This causes an
invalid pointer dereference. Add a NULL check.
Change-Id: Ia5d9897038a22fe44aab5106dd6b84c5a358512d
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
This requires strstr() from minimal libc, thus requesting such extension
to be built relevantly.
Jira: ZEP-598
Change-Id: I943d8046b6165fbcebec9cbabd7b874b19160d48
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
When application wants to send zero length data, packet is dropped.
And uip_appdatalen is wrongly assigned with total IP packet length.
Jira: ZEP-575
Change-Id: I7f714cbef74dc28b83db7a776ef80a3026ae120e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Follow up to TSC decission for further discussion in the networking
WIG.
Change-Id: I148b484dfe308661573e47ed3e60cceed673bddf
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Now that minimal libc has assert.h, we can remove the workaround from
tinydtls.
Change-Id: I3bb001d1891f0b110b43133d30c262ba320450f7
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Created menu for Ethernet driver and moved driver + debugging setting
under it. Changed prompt from "Grove log level" to more describing and
fixed typos.
Change-Id: If2f79fee1a002a42e89e2493a2294332abec05ee
Signed-off-by: Jani Pajarinen <jani.pajarinen@intel.com>
Call ICMPv4 handler when receiving such a network packet.
Currently only echo-request is handled.
Change-Id: Ib59c65b38f13c484f1842485118dad32fb6a6f36
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The host will be able to respond to ICMPv6 messages.
An echo-request handler is implemented and it will send
echo-reply when needed.
Change-Id: I08f4703bab5cf3e95d3ae722ebc7a386d22fe17e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Various network utility routines can debug print after this.
The Kconfig option is called CONFIG_NETWORK_IP_STACK_DEBUG_UTILS
Change-Id: I8384f974bd3c4965a6ef401bff8060389fab51ad
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The double include of Kconfig.debug causes the following warning:
scripts/kconfig/conf --silentoldconfig Kconfig
/home/jh/src/zephyr/net/ip/Kconfig.debug:45:warning: choice value used outside its choice group
/home/jh/src/zephyr/net/ip/Kconfig.debug:47:warning: choice value used outside its choice group
/home/jh/src/zephyr/net/ip/Kconfig.debug:49:warning: choice value used outside its choice group
Change-Id: I3f59587eed656b67e1f69e2a8151288f41b50769
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Using net_receive with long timeouts breaks net_reply. Sending a lot of
packets in a row without yielding causes failures since the network
stack can't send them. Add yield code for both net_reply and net_send.
Jira: ZEP-469
Jira: ZEP-497
Change-Id: Ic59769462e0575da0898d35745d49647f7e43edd
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
When handling TCP packets, ip_buf_len is set 4 bytes too big.
Recalculate the value when handling it.
Change-Id: I6502bd58d3860f6318dca668b7b1d6b556d34c2a
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
There is now Kconfig option to enable net_if debugging.
Also use NET_DBG() instead of directly calling syslog macros
so that we can print fiber id automatically.
Change-Id: I150d363006e4be358c38308a93771ba444b0835e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of directly calling printk/printf, the network printing
macros will use syslog macros defined in sys_log.h
Change-Id: I3f12f81557f50b24ca47a43f345162f9ffbd574c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The YAIP stack uses CONFIG_NET_IPV4 to compile IPv4 support.
Change-Id: Ia4a579591d6d2050e168c35e68546281043d53a8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The YAIP stack uses CONFIG_NET_IPV6 to compile IPv6 support.
Change-Id: I25c3b2d6775ed610fca43960a569ddab0ec470aa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
uIP specific debug options are shown only when uIP is
being compiled.
Change-Id: Ieea5db021227a2b3cbe625a9c774e7c1f99b5e83
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is a placeholder that just compiles but does nothing else.
Change-Id: I9689fa26eb13bc23d29940938f7b3c11f32b2ff1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
ip_buf_sent_status is only available for TCP, but uip_send_udp is only
called for UDP. Remove the else block.
Change-Id: I9695b33f975042ec15fde718d91ab901617437f2
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
When udp_packet_receive is called, ip_buf_len is set 4 bytes too big.
This ends up with the client program receiving 4 bytes more than the
board actually received. Initialize it correctly alongside other values.
Change-Id: I0012aa7e8c6a440a618dfa03c4fdc2b898d592fc
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
The net_buf API ensures that the frags pointer gets initialized
properly. Using nano_fifo_get could mean that buf->frags is something
else than NULL if there was more than one item in the FIFO.
Change-Id: If65e85a7cbe82f562307dc781d48110c3be0472b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Refactors L2CAP core data structures and modifies functions that uses them.
Now we can have separate L2CAP feature channel objects for LE and BR/EDR
transport. This's also a ground for make L2CAP CoC API to be common
for both transports.
Change-Id: Ic1197b0e3c4f505764b23fb9c7eb27123a44a675
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
DHCP client support provided for IPv4 over ethernet.
Change-Id: Ia89bc4123842cf109813b80a90b70cf50cc52e0a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Earlier default was 8, new default is 4.
Change-Id: I99c9d2aae465fd0feb968efa7417cd28bafd73b8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Earlier default was 10, new default is 2.
Change-Id: I307a4abaad34223254fd32e1fd4357892a04a2d0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Earlier default was 10, new default is 2.
Change-Id: I938449d840a244a13e9b9b954648577b76db00bc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The network context is similar concept as network socket.
Depending on application use, the number of contexts can be
now tweaked. Default value is now 2, it was 5 earlier. Using
the lower number saves 241 bytes of memory.
Change-Id: I6e2a9f053c8c63163af6d6175783233f67553ae9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This saves little over 4kb of memory.
Change-Id: I4dc3812b11de2736e2bdc17042e47fcdf5cf5491
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
User cannot select CSMA mac driver any more in order to save some
memory.
Change-Id: I7805a1c2028f60bc8a428bd5b8f891d540a14b6d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The ethernet driver calls net_set_mac before net_init is
called (ie before the uip stack has been fully initialized).
Unfortunately net_set_mac calls the function uip_ds6_set_lladdr.
Therefore this function is called before uip_ds6_init: this is an
issue as uip_ds6_set_lladdr is setting some static data which are
going to be erased by uip_ds6_init. In some case it could even lead
to a system hang due to a timer set twice.
To fix this issue net_set_mac should check whether net_init has been
already called. If not net_set_mac should simply copies the mac
address into uip_lladdr. Indeed uip_ds6_init automatically calls
uip_ds6_set_lladdr for the address stored into uip_lladdr.
Change-Id: Ifbcb07e7cd493b6284a85d70f2439d434cebbb00
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>