If the app does direct provisioning, it may still want to do common
handling through its provisioning complete callback (if it has one
registered). This also means that we always require a non-NULL
provisioning context provided to bt_enable(), and that it needs to
fail if NULL was given.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It may be useful for the app to know what the initial NetKeyIndex that
it was given during provisioning is.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is in anticipation of soon adding health client support, which
could then cause confusion due to the ambiguous API names.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that there's support for configuration client as well, rename cfg
to cfg_srv to avoid any confusion.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Some of the provisoning routines, such as node reset assume that we
have a valid bt_mesh_prov pointer.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add the ability to track the provisioning bearer through an extra
parameter to link_open/close. Also introduce new public functions to
enable/disable specific provisioning bearers. This also means that one
now needs to explicitly enable provisioning bearers after calling
bt_mesh_init().
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The original fragment chain of incoming packet will be lost and leaked
in case of early error, add frag back to packet and
let the caller do unref.
Fixes#4323
Signed-off-by: june li <junelizh@foxmail.com>
No need to do any IPv6 neighbor checks if the packet is routed back
to us by loopback driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of passing net_pkt as is to the receiving side of the
interface, clone the sent packet and drop the sent one.
This is needed mainly in TCP where passing the same packet from
sending to receiving side is causing havoc.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is loopback interface, then let it handle all local
traffic. Loopback interface is only needed for test applications.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The command name and a shortened form of valid parameters is not
necessarily enough to understand its usage. Add the option of
providing a more lengthy description of the command usage.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This gives more detail on how system calls with large argument
lists, or large return value types should be handled.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
If the packet is too short, the TCP header pointer might be
NULL. In this case we just need to bail out.
Coverity-CID: 178787
Fixes#4787
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
It is possible to access past end of url buffer by one byte.
Coverity-CID: 178790
Fixes#4784
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Most commands provide a short string to describe the parameters it
takes. Provide this help text as part of the list of supported
commands for each module.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The numeric format specifiers already have this support, but strings
didn't. This makes it possible to add padding after strings, using
format specifiers such as %-10s.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This function wasn't working on systems that enabled the stack
sentinel as the first 4 bytes of the stack buffer contain the
sentinel value for thread stacks.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The script argument isn't really a path, so stop assuming that it is
one. We still use the shell script name at this point, but there isn't
any actual shell script in the system.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We append a path to the FLASH_SCRIPT/DEBUG_SCRIPT that was bogus and not
really needed by zephyr_flash_debug.py. So lets remove it since its
just confusing.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If CONFIG_NET_SLIP_TAP is not selected QEMU_NET_STACK will not work
which happen when CONFIG_NET_L2_BT is selected.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
All arguments comes from userspace has data type u32_t but
base.prio has data type of s8_t. Comparision between s8_t and u32_t
cannot be done. That's why typecast priority coming from userspace(prio)
to s8_t data type.
Signed-off-by: Punit Vara <punit.vara@intel.com>
The new mem pool implementation has a hard minimum block size of 8
bytes, but the macros to statically compute the number of levels
didn't clamp, leading to invalid small allocations being allowed,
which would then corrupt the list pointers of nearby blocks and/or
overflow the buffer entirely and corrupt other memory.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The end_sema k_sem was only initialized on one of the several paths
that used it, leading to some crazy clobber-the-run-queue behavior
that was dependent on linkage order (see the linked bug) when end_sema
and the pipe object were made non-static..
Adding a k_sem_init() call fixes the corrupt issue, but really the
right thing is to use the DEFINE macro, so do that instead. Note that
that the initializer changes the linkage order too (by putting the
semaphore in a separate segment), so... yeah, it's actually impossible
to prove that this patch in isolation resolves the issue seen without
manual validation.
Issue: https://github.com/zephyrproject-rtos/zephyr/issues/4366
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add commands for 1-byte states such as Default TTL, Friend and GATT
Proxy, as well as the 2-byte Relay state.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add support to the Configuration Client Model for getting and setting
1-byte states (which can be nicely generalized in code) as well as the
2-byte Relay state.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>