Age | Commit message (Collapse) | Author |
|
|
|
Without this fix a call to getenv() without parameters destroys environ,
and subsequent calls to getenv() (with or without parameter) return
nothing.
Fixes: #219
Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tests: replace test runner shell script with ucode implementation
|
|
The ucode interpreter and libraries are mature enough to execute their
own testcases now, so replace the existing shell script with an equivalent
ucode implementation.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
In case the ucode cli executes stdin with zero bytes length, ensure to
pass a dummy string instead of a NULL pointer to uc_source_new_buffer()
to prevent libc's fmemopen() from writing to nonexistent memory.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Hwsim support
|
|
The mac80211_hwsim module exposes a custom generic netlink family for
managing simulated phys and userspace data frame transmission.
Since hwsim functionality is closely related to nl80211 and useful to
e.g. manage simulated wireless testbeds, I decided to include support
directly into the nl80211 module.
Example calls for creating and destroying hwsim wiphys:
nl80211.request(nl80211.const.HWSIM_CMD_NEW_RADIO, 0, {
perm_addr: "02:11:22:33:44:55",
support_p2p_device: true
});
nl80211.request(nl80211.const.HWSIM_CMD_DEL_RADIO, 0, {
radio_name: "phy2"
});
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
The `nlctrl` and `nl80211` family pointers were never used, so drop them
from the connection context structure.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Some netlink attributes, e.g. `HWSIM_ATTR_TX_INFO` contain arrays of
structures. In order to cover this use-case, extend the ucode <-> nla
conversion routines to support `DT_NESTED` declaration in conjunction
with `DF_ARRAY`.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Some generic netlink commands, e.g. `HWSIM_CMD_NEW_RADIO` might reply with
a bogus netlink error message containing a positive error code, leading
to an infinite loop in `uc_nl_request()`.
Gracefully deal with such occurrences by remapping the error code to
`NLE_RANGE` with a custom message.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
nl80211: add wiphy multi-radio support
|
|
Support new attributes that describe multiple radios belonging to a single
wiphy.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Includes the new attributes for wiphy multi-radio support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
For newly added attributes, the kernel prefers to no longer add a nesting
container attribute. Instead, an attribute with the element type is simply
added multiple times within the outer container.
Add support for this array style, which will be used in the pending wiphy
multi radio support.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Only one place needs access to another attribute from the tb array
(HE MCS rates). In order to make that access possible, add a flag to indicate
a second attribute dependency via auxdata.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
Introduce a new "zlib" library which provides simplified bindings for
zlib inflate/deflate operations.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
Add fs module utility functions
|
|
Implements file based locking on a given file handle.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Trunates the file referenced by a file handle
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
- document optional 'base' parameter on 'int' function
- add description of 'fn' parameter call sequence to 'map'
- add several usage examples to both 'int' and 'map'
- reference similarity between 'map' and 'filter' use of 'fn'
- fix a few typos
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
|
|
Socket improvements
|
|
Implement socket.recvmsg(), socket.sendmsg() and support for encoding
and decoding well known control message types.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
- Handle varying integer sizes for socket option values
- Support interfaces name and index option values
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
- Treat address string values containing slashes as AF_UNIX addresses
- Default to SOCK_DGRAM for non AF_INET, AF_INET6 sockets
- Gracefully handle EOPNOTSUPP condition after listen() call
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Treat address strings containing slashes as AF_UNIX paths and do not
attempt to resolve them.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Do not attempt to calculate a dynamic length for AF_UNIX socket addresses
but return the total size of `struct sockaddr_un`, like we do it for the
structures of other address families as well.
Fixes incorrect domain socket path truncation.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Remove an accidentially copy-pasted jsdoc comment block.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
socket: optimize poll() argument handling
|
|
Optimize the poll() function implementation to re-use passed in socket/flag
tuple arrays as-is in the return value array, which simplifies attaching
state to sockets for user code through subsequent fields in the tuple array.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
socket: fix potential memory leak in connect()
|
|
If a non-string value which cannot be interpreted as socket address
structure is passed to connect(), the function will leak the internal
address vector when returning the error.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Actually pass NULL to getaddrinfo() when the service argument is omitted,
instead of incorrectly translating it to a string containing "null".
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Fixes: 0662de6 ("socket: add AF_PACKET socket type support")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
socket: add AF_PACKET socket type support
|