Options parsing helpers functions unable to handle the malformed
packets and dropping it. Improved parsing functionality to handle
malformed packets. Also payload marker is not mandatory in CoAP
packets when there is no payload. Exit gracefully when CoAP
packet contains only options.
Fixes#4396.
Coverity-ID: 178060
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Now that we have a newer version of bossa in the SDK we can use a
version where there -p option works properly.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We need to skip protocol headers when setting pointer to
application data when receiving TLS data.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fixes this function parameter datatype warning:
expected ‘k_thread_stack_t * {aka struct _k_thread_stack_element *}’
but argument is of type ‘u8_t * {aka unsigned char *}’
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If user has enabled CONFIG_NET_DEBUG_APP, then the debugging
version of _net_app_select_net_ctx() was not properly declared
and it caused compile error.
Fixes#4481
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The implementation of the Network Message Cache has so far been
suboptimal, since it has treated the same packet with different TTL
values as different packets. Since one of the purposes of this cache
is to prevent unnecessary relaying, it's important that we don't let
the TTL value influence the "hash" that's used for matching messages.
This patch changes the hash to consist of most of the IV Index (three
least significant bytes of it), the sequence number and the source
address, which should give fairly optimal matching behavior.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We shouldn't select BOARD_DEPRECATED but set a string with the release
version that the board will get removed in.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The payload variable was one byte long but we read 32 bytes
from it.
Coverity-CID: 178064
Fixes#4397
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we receive a neighbor solicitation which does not have any
options, then there is no need to assert this condition as that
is a perfectly valid use case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If IEEE 802.15.4 reassembly function ieee802154_reassemble() returns
anything other than NET_CONTINUE, then drop that packet. Earlier
it only dropped the packet if NET_DROP was returned but the reassembly
might also return NET_OK. In that case the pkt is freed already and
pkt->frags pointer is NULL. This caused NULL pointer access in L2 when
packet was received.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
`rc` gets assigned values from function returning `int` and not
`u32_t`.
Fixes#4051.
Coverity-ID: 177219
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Using the PAE page tables it is possible to disable code execution
form RAM.
JIRA:ZEP-2511
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Replacing the default paging scheme from 32-bit paging to
PAE paging in QEMU.
JIRA:ZEP-2511
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Page Address Extension(PAE) page tables make use of NXE bit in
EFER register.
This patch enables the capability needed to set this bit.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
In PAE boot tables the __mmu_tables_start points to page directory
pointer (PDPT). Enable the PAE by updating the CR4.PAE and
IA32_EFER.NXE bits.
JIRA:ZEP-2511
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Created structures and unions needed to enable the software to
access these tables.
Also updated the helper macros to ease the usage of the MMU page
tables.
JIRA: ZEP-2511
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
If CONFIG_X86_PAE_MODE is enabled for the build, then gen_mmu.py
would generate the boot time page tables in PAE format.
This supports 3 level paging i.e Page Directory Pointer(PDPT), Page
Directory(PD) and Page Table(PT). Each Page Table Entry(PTE) maps to
a 4KB region. Each Page Directory Entry(PDE) maps a 2MB region.
Each Page Directory Pointer Entry(PDPTE) maps to a 1GB region.
JIRA: ZEP-2511
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Page Address Extension(PAE) page tables would be used
if this option is enabled.
JIRA:ZEP-2511
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Now that all the yaml binding files are in dts/bindings lets limit the
search path for bindings to that location.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Moved yaml files to be under dts/bindings and have the bindings try
and match the linux doc device tree binding dir structure as the
canonical binding reference.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Cleanup how we find the yaml files for device tree bindings. Move to a
recursive dir search of the dts/ dir. This will be useful for
supporting re-organizing of the yaml files to match binding dir
structure.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This is similar to how few commands already behave if they can
provide additional info to the user if particular config options
are enabled.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Loopback is a networking interface which doesn't actually transfer
any data via link layer externally, and instead just mirrors back
(i.e. any packet send to the loopback interface will be received from
it). This interface very useful for testing.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Make drivers/net/ be the place for misc networking-related drivers
(otherwise, we'd need to have a new dir per driver).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
net_pkt_tcp_data() and net_pkt_udp_data() simply returns the start
address of the header. However the header may span over multiple
fragments, unexpected data or memory corruption might happen when
reading or writing to the pointer directly.
Use net_tcp_get_hdr() and net_udp_get_hdr() instead.
Signed-off-by: Aska Wu <aska.wu@linaro.org>
The net_tcp_get/set_hdr() and net_udp_get/set_hdr() documentation
was not clear in corresponding header file. Clarify how the return
value of the function is supposed to be used.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
udp.h is out-of-date as it accesses net buf directly. In 3604c391, it
has been replaced by net/udp.h and udp_internal.h
Signed-off-by: Aska Wu <aska.wu@linaro.org>
Previously net_pkt.h, defined macros NET_PKT_TX_SLAB_DEFINE,
NET_PKT_DATA_POOL_DEFINE, but advertised them as intended for
"user specified data". However, net_pkt.c effectively used the
same parameters for slabs/pools, but this wasn't obvious due
to extra config param redirection. So, make following changes:
1. Rename NET_PKT_TX_SLAB_DEFINE() to NET_PKT_SLAB_DEFINE()
as nothing in its definition is TX-specific.
2. Remove extra indirection for config params, and use
NET_PKT_SLAB_DEFINE and NET_PKT_DATA_POOL_DEFINE to define
system pools.
3. Update docstrings for NET_PKT_SLAB_DEFINE and
NET_PKT_DATA_POOL_DEFINE.
Overall, this change removes vail of magic in the definition of
system pkt slabs/pools, making obvious the fact that any packet
slabs/pools - whether default system or additional, custom - are
defined in exactly the same manner (and thus work in the same manner
too).
Fixes#4327
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The relay functionality was supposed to be always enabled rather than
always disabled on the micro:bit.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
nucleo_f030r8 fails in CI because applications need
more RAM.
Reduce kernel memory used by stacks and ISR vector table.
Fixes#3923
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Some SOCs (e.g. STM32F0) can map the flash to address 0 and
the flash base address at the same time. Prevent writing to
duplicate flash address which stops the SOC.
Allow Cortex M SOCs to create their own vector table relocation
function.
Provide a relocation function for STM32F0x SOCs.
Fixes#3923
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
The commit delivers HAL/LL static library source files for STM32F0 SoC.
Using STM32Cube provides generic access to all families, maximizes
code reuse across different STM32 families and helps taking benefits
of a mature SDK.
Origin: STM32Cube
URL: http://www.st.com/en/embedded-software/stm32cubef0.html
Purpose: Introduction of STM32F0xx STM32Cube definitions
and Abstraction Layers
Maintained-by: External
Original STM32Cube tree structure has been modified to a minimum
structure for a better fit into Zephyr. HAL is split into 2 parts:
-driver: initially Drivers/STM32F0xx_HAL_Driver, contains HAL and LL
-soc: initially Drivers/CMSIS/Device/ST/STM32F0xx, contains stm32f0xx
SoCs header files.
Fixes#3923
Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
The original developer no longer has a working board and isn't
interested in maintaining support for the board. Mark the board
deprecated for now and see if anyone wants to pick it up, otherwise will
remove it in a future release.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Atmel SAM3X series has been recently converted to use ASF and
should now use common SAM family drivers. The i2c_atmel_sam3
I2C driver will be removed in the future.
This commit also changes the default I2C driver for Arduino Due
board from i2c_atmel_sam3 to i2c_sam_twi.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>