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 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>
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>
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>
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>
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>
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>
Dropping legacy API. This commit also contains updated
unit tests in order to pass the test.
Change-Id: Ibc7426837e2f4f23bb5f3ed3719635c5c3d0ed0f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Also fix typo in debug print when discarding a packet.
Change-Id: I3ac41e86d7b2dc05b9d92cde93a646f2dc49d8c0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The bitwise and operator was being applied to a boolean operand because
of lack of parenthesis in the expression.
Change-Id: Ibfbdd8acce9db95f9274f48fd145f4d8467508e2
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Replace NANOKERNEL by POST_KERNEL in the net stack.
Change-Id: Iaad7cdbe849741bc1cf18b0ccf7264417a9495d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
IPSP spec states other security level can be used depending on the use
case:
7.1 Node Security Considerations
This section describes the security requirements for the Node.
The Node may use the SM Slave Security Request procedure to request
an LE Security Mode other than LE Security Mode 1 Level 1 if required
by the use case.
Change-Id: I24c6676bdb05099a7e222085ee41539994eea77f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth driver requires BLUETOOTH_SMP in order to build properly since
BLUETOOTH_L2CAP_DYNAMIC_CHANNEL depend on it.
Change-Id: I7878c0c26ebf688b2a7321eb37025a9ebde6c6b8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
More logical place for net_ipv4_broadcast_address() is in ipv4.c
instead of net_if.c.
Change-Id: I069f5030963bcb809df34e874054e2b7826ff868
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>