There is something wrong with Arduino 101 ARC compiler.
Sanitycheck runs ethernet tests for this board basically using
this command:
cd tests/drivers/build_all
make pristine && make CONF_FILE=ethernet.conf BOARD=arduino_101_sss
Which then gives following warning
warning: missing braces around initializer [-Wmissing-braces]
which is then converted to error in sanitycheck.
Change-Id: I822c599cb172825a79b5b8e4a71cb9252757a435
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The net_buf tests were including net_ip.h which requires some
extra config options to be usable when the new native IP stack
is used. In order to avoid this dependency, define struct in6_addr
locally in the source file.
Change-Id: Iafe0d2b5b507665baaed23f5e2c55a9d9a300d47
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The 802.15.4 frame has a header and in the end after the payload a CRC.
Overall MTU is 127 bytes, but CRC is most likely going to be generated
by the device itself (offloading). Because the limitation of current
nbuf, it's not possible to keep this CRC in the buffer because it
require a user data size of 127 bytes but if we do so, IP stack will
fill in as much as it can as packet data, thus occupying the 2 last
bytes. This generates bugs. A perfect solution would be to generalize a
better handling of MTU and head or tail reserve data into nbuf, but
this will probably be solved in the future.
Change-Id: I1a0fee4d555e2717c1edd5afba399a1f17d9c7a9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
User is able to send ICMPv4 Echo Request to destination
address.
Change-Id: Ie32d5970e5f3e75e925c283947f97e096e509555
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the destination IP address is loopback, then bypass
the L2 layer and directly feed the IP packet back to us.
If the destination IP address is unspecified, then
drop the packet.
All this is only done if CONFIG_NET_IP_ADDR_CHECK is
set as this extra processing can be unnecessary if
it is always known what addresses the device is going
to use. By default the address checking is enabled.
Change-Id: I323cce97a72533c75b0424870f08729479024ebf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Create utility functions to create IPv4 packet if the
network context is not known.
Change-Id: I982830d09f3b91e23b75e6b63a5d97bfea0e8d4e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the user uses set_module command, then the target host
name pointer will be wrong. This is fixed so user can
either say "net ping 2001:db8::2" or if set_module command
is used "ping 2001:db8::2"
Change-Id: I708c53e329a11a18fcb448b34213e4b2f19c6390
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Due to huge delays with DEBUG log level change it to INFO.
Change-Id: I81caf78fc6e9e064c2ed8e18caa99351028af62a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
In a case transmit is failed send ack to the driver with zero sequence
number which is not used for valid seqs.
Change-Id: I1047de9ab5de636c5a8983f31376046757c4dc0c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Following replacing semaphore with timeout semaphore transmit may not
be finished returning error after which communication stalls. Allowing
3 retransmits solves the issue.
Change-Id: Ibad05c2eac43dd6bb0ed72aaf16a7a2ef4185067
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Having 1024 bytes was really unsufficient and creating a lot of weird
bugs everywhere.
Change-Id: Ib642744fa6dfc9f3a699a0dc2f0c1783dc6f87b2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Semantic has changed in k_sem_take in comparison with legacy
nano_sem_take.
Change-Id: I06129b6f15f66266919bf371c2358e5634109156
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is meant to test echo applications with 802.15.4 L2 directly in
qemu.
Change-Id: I0edccd8c39360421dc77e0064147221d86877bdf
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Use frag->data as a reference, not net_nbuf_ll or net_nbuf_ip_data.
Print out packet before compression/fragmentation, so it will help to
spot issues after such process.
Make sure as well no coloration is done if frag reserver is not set.
Change-Id: I7f1bdc9e5c39913b8d7f62b5ffacb9ba3e11ecc8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit adds the MQTT high-level API with Quality-of-Service
support. The following MQTT messages are covered by this commit:
CONNECT (tx), DISCONNECT (tx), PUBACK (tx, rx), PUBCOMP (tx, rx),
PUBREC (tx, rx), PUBREL (tx, rx), PUBLISH (tx), PINGREQ (tx),
SUBSCRIBE (tx), UNSUBSCRIBE (tx), CONNACK (rx), PINGRESP (rx),
SUBACK (rx) and UNSUBACK (rx).
Where 'tx' stands for transmission: routines that create and send
messages. 'rx' stands for reception: routines that receive an RX
buffer from the IP stack and parse the MQTT mesage contained in
that buffer.
Jira: ZEP-365
Jira: ZEP-591
Jira: ZEP-856
Change-Id: Ibee701a298127eb713aa3fde5aaf7d089ecd1b9d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
Do not color the packet hexdump if there is no reserve set.
Do not print the ll part after 6lo compression/fragmentation.
Print out the actual frag being sent in radio driver.
Change-Id: I43118203c37fc76f60673c046732c8655ab7067b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thus no need to copy anything from there.
Change-Id: I1090f42f7fa5429748c973a656f9d25333ff16af
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Which happens only when internal DEBUG is set to 1
Change-Id: I175943f32065ae81b1a4453dde40f36738c28084
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Unified kernel uses K_FOREVER so use it instead.
Change-Id: I24ae75e99cf54d6959c014b8a848e22a33848657
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move most of the code to send a control segment to a single function to
avoid copies of boilerplate code in a few functions.
Change-Id: Id2d4770b6bec3f10b4eb786af3eb2a25482d953d
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This implements the active close state set (FIN_WAIT_1, CLOSING,
FIN_WAIT_2, TIME_WAIT).
Change-Id: Id146ba3d6a774bfeac93401779a246fd32e2c523
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
For certain scenarios, such as handling TCP active close, where the
state group {FIN_WAIT_1, FIN_WAIT_2, CLOSING, TIME_WAIT} can be reached
from more than one state (ESTABLISHED and SYN_RCVD respectively), it's
cleaner to handle all the transitions inside a single callback
function.
Change-Id: I3d4d210dd667fef5cf81d5174d626adbf8675019
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This transitions a connection to FIN_WAIT_1 state if it was in either
SYN_RCVD or ESTABLISHED states and the local peer decided to close the
connection.
A timer is started to close the connection after 2 MSL (which is 120
seconds; this might be easily tunable through kconfig). No transition
from this state to FIN_WAIT_2, CLOSING, or TIME_WAIT are implemented on
this change: oncoming changes will implement the rest of this
machinery.
Change-Id: Ic9e2eceef81a82fb37c0a829860cfcf52f424475
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The net_buf structs were being dereferenced when the packet was
correctly sent by the underlying layers, and never on error. This
could lead to crashes, double unrefs, and buffer leaks.
Change-Id: I81b280f9d108c18ebe0e5914b73da4656afbd6ae
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
If a packet with the FIN flag is received while in ESTABLISHED estate,
transition to CLOSE_WAIT and send the ACK as usual.
The act of preparing a segment in CLOSE_WAIT state will automatically
transition the TCP context to the LAST_ACK state. Next time a packet
comes in with the ACK flag set, put the context.
Change-Id: I245c8b7755f9db140b85ffad52e2e10cc74e7781
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Instead of having to write "NET_TCP_BUF(buf)->flags & NET_TCP_CTL"
every single time, provide a NET_TCP_FLAGS macro that expands to this
expression.
Change-Id: Ie876c538599fabae6b800a53613b6ad17dc45620
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Previous commits support auto configured IPv6 addresses so no
need to manually tweak the address settings.
Change-Id: Ie641212981a04229721c84990a54876977d9cfc4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Create a timer when router is added, update it if needed after
receiving Router Advertisement, and then delete the router lifetime
timer when the router is removed from the system.
Change-Id: I784e0534da300fdcb43349d9cf40354ebe109e07
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Received Router Advertisement messages were incorrectly received
and handled which could cause hanging or crashing of the system.
Jira: ZEP-1267
Change-Id: I05b57221581e9f671825dbc147adb0a55bea091e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Print information about every unknown RA option we receive.
These options need to be implemented later.
Change-Id: Ic2d189e4a130162569a81ca58d38b8129183b2fd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Setup IPv6 address lifetime timer if needed and start Duplicate
Address Detection procedure for every IPv6 address added to
the network interface. If the IPv6 address is removed from
network interface, cancel any pending lifetime timers.
Change-Id: I5b6ffd97836cfe78ddb9ff8fdb78d8be0bb81348
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The validity time is already converted to host byte order
when reading the field from the Router Advertisement message.
No need to use ntohl() here.
Change-Id: If1106748f268a245871510563c7e7849020e3b3a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is needed in other part of the stack in order to able to
parse packets properly.
Change-Id: I8082860333bdcb2c6114d517ff0b782b9ba526a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit fixes the case when we receive large amount of
data and then copy it into new fragments. If the MTU is larger
than the fragment size, then it is possible that we might
overwrite net_buf memory and crash. This is typical in ethernet
network.
Change-Id: Ib1c65819c3bc718ec04f558e3df235246b5655dd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The DTLS client will not longer use the legacy IP stack.
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I7402a188fc7501873d98d3b6cb2f03ee51f3506b
commit-id 67c465d2cc introduced this
weird format by not removing unnecessary spaces.
Change-Id: I964185c8a894cfcf10e253e6d378c63ec02ad8d7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Commit 7bdd30d99d447b89b89c7fb0c76d52586744176f was properly swapping
incoming ll address, but in case of sending, frame creation logic is
already doing the job properly.
Change-Id: I864abba9b09f9176b3f1efec6055c193f3fbabc9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>