Commit graph

24 commits

Author SHA1 Message Date
Flavio Ceolin c4f7faea10 random: Include header where it is used
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-07-08 21:05:36 -04:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Jukka Rissanen 1fea82c125 net: ipv6_fragment: Remove extra net_pkt_cursor_init() call
The net_pkt_pull() will reset the cursor after its call so no
need to call it here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-05 13:39:45 +03:00
Jukka Rissanen ccba1036c5 net: ipv6: Fix fragmentation
The next header was not properly set in the de-fragmented
packet.

Fixes #16354

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-23 15:40:27 +03:00
Ravi kumar Veeramally 25309eb356 net: ipv6: Trivial changes in fragmentation debug
Values are misleading when debugging IPv6 fragmentation.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-04-26 10:45:45 +03:00
Tomasz Bursztyka 26a335c2e8 net/ipv6: Fix IPv6 fragment nexthdr field in case of no option headers
With or without options headers it has to work. Currently it was
setting always hop-by-hop next header which is obviously wrong but
worked on ipv6_fragment test since that one has only packets with
optional headers (hop-by-hop in that case has to be the first optional
header).

Fixes #14622

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-04-02 13:18:46 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Tomasz Bursztyka d6d52ce9e5 net/pkt: Remove _new suffix to net_pkt_write functions
Suffix is now useless, as these functions are now the only ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka a25f054cbd net/pkt: Remove _new suffix to net_pkt_read functions
Suffix is now useless, as these functions are now the only ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka f8a091104e net/pkt: Remove _new suffix to net_pkt_get_data_new function
Now that legacy - and unrelated - function named net_pkt_get_data has
been removed, we can rename net_pkt_get_data_new relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka c71ce193c4 net/pkt: Rename net_pkt_pull_new to net_pkt_pull
Now that legacy net_pkt_pull function has been removed, the new
function can be renamed accordingly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-12 20:24:02 -05:00
Tomasz Bursztyka c65304f088 net/pkt: Rename net_pkt_copy_new to net_pkt_copy
Now that legacy net_pkt_clone function has been removed, the new
function can be renamed accordingly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-12 20:24:02 -05:00
Tomasz Bursztyka fd1401495b net/tcp: Move net_tcp_set_hdr() away from net core
Only the unit test needs it now, so let's move it there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-12 20:24:02 -05:00
Tomasz Bursztyka 0c80a84bc7 net/ipv6: Rename net_ipv6_finalize since legacy version disappeared
s/net_ipv6_finalize_new/net_ipv6_finalize

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-12 20:24:02 -05:00
Tomasz Bursztyka e04914a963 net/ipv6: Switch sending fragmented IPv6 packet to new API
This optimizes the memory quite a bit since we do not need to clone nor
split the original packet at any time.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-01 14:34:38 +02:00
Tomasz Bursztyka 2d5f8b9317 net/ipv6: Re-enable support for fragmented packet at input
Now using the new API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-01 14:34:38 +02:00
Jukka Rissanen a7afdc3512 net: rpl: Remove the deprecated code
The RPL was deprecated earlier so remove it by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-13 09:40:36 -05:00
Jukka Rissanen 86689030e8 net: Clarify logging in networking code
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.

Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.

Fixes #11343
Fixes #11659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Patrik Flykt b97db52de7 misra-c: Add 'U' to unsigned variable assignments in subsys/
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Ruslan Mstoi f1c67615cf net: ipv6: Add Destination Options Header support
This patch adds support for IPv6 Destination Options Header

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2018-10-25 16:50:15 +03:00
Jukka Rissanen 57a8db7789 net: Use log_strdup() when printing debug strings
As the debugging print calls are async, all the strings that might
be overwritten must use log_strdup() which will create a copy
of the printable string.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen a76814bfb6 net: Convert core IP stack to use log levels
Instead of one global log level option and one on/off boolean
config option / module, this commit creates one log level option
for each module. This simplifies the logging as it is now possible
to enable different level of debugging output for each network
module individually.

The commit also converts the code to use the new logger
instead of the old sys_log.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Ravi kumar Veeramally 005f014ce4 net: ipv6: Initialize memory
Fix accessing uninitialized memory. Fixes coverity issue.

Coverity-CID: 187902
Fixes: #9768

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-09-04 08:10:18 -04:00
Ravi kumar Veeramally 7aff94dc5a net: ipv6: Separate IPv6 fragment functionality
No functionality changes. Just moved IPv6 fragment and related functions
to ipv6_fragment.c for better readability

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-08-17 17:01:54 +03:00