Commit Graph

1653 Commits

Author SHA1 Message Date
Christian Prochaska
f773c46b5d libusb: adapt to changed packet stream blocking semantics
Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
ac691eb229 file_system/util.h: remove packet-stream helpers
The 'read' and 'write' utilities are from a time before the VFS API
as os/vfs.h was available. They rely on the (now removed) blocking
semantics of the packet-stream interface.

The only remaining legitimate use case of the direct interaction with
the file-system session without VFS is the back end of gcov, which needs
a way to exfiltrate the statistical data using a channel that is
independent from the libc or the VFS.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
0f56e76e7a rom_to_file: use VFS instead of fs session
This patch replaces the former direct use of a file-system session by
the use of the VFS API.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
7605101665 fatfs: use Block::Connection::Job API
This patch removes the use of blocking packet-stream calls from the
backend of the fatfs library.

Issue #4390
2022-02-15 10:10:03 +01:00
Christian Prochaska
2591c61e7d libusb: guard USB session packet allocator
Fixes #4389
2022-02-15 10:10:02 +01:00
Sebastian Sumpf
299a35d943 libdrm/iris: check if VFS '<gpu/>' is present
On startup check if '/dev/gpu' is present and issue an error in case it
is not.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
4cb8c91b08 libdrm/iris: import GPU buffers lazy optimization
Do not import a freshly allocated buffer to all contexts eagerly.
Instead check buffer list in context's 'exec_buffer' call and import
only buffers needed and not present before GPU execution. This leads to
improved performance for applications that use many OpenGL contexts
(e.g., VirtualBox 6).

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
3c97fdbc0e libdrm/mesa/iris: Don't use Genode::Env any more
'vfs_gpu_env' handles this now for all applications.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
c35d2aff45 libdrm/iris: add gem context support
Retrieve multiple GPU sessions from VFS plugin, take advantage of buffer
import/export functionallity in order to implement gem context support.
Multiple contexts share all GPU buffers, but use different GPU sessions
and thus, differnt page tables and hardware contexts.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
567b9dfa39 libdrm/iris: use VFS/GPU plugin
Synchronize GPU completion by calling 'read' of the vfs_gpu plugin. This
enables pthreads to wait for GPU completions instead of the main EP.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
b7d25636e5 mesa_gpu-iris: iris is linked into mesa already
* remove from library dependency

issue #4380
2022-01-19 15:01:24 +01:00
Sebastian Sumpf
ce409a2438 libdrm/iris: map PPGTT buffers lazy + lseek
* let iris handle buffer management, this implies that BOs are mapped to
  the PPGTT during buffer execution and unmapped by iris later, for this
  to work buffers need to be unmapped when allocating cached BOs
  (vma_free) which requires a patch

* support lseek (drm_lseek for now) for determining object size

issue #4380
2022-01-19 15:01:22 +01:00
Josef Söntgen
94405e9280 libdrm/iris: remove tiling short-cut
Instead of ignoring the request, we store the tiling information and
apply them when the buffer is mapped via 'MMAP_GTT'.

issue #4380
2022-01-19 15:01:11 +01:00
Josef Söntgen
e77a54614d libdrm/iris: introduce session resource accounting
Track RAM and CAP resource usage locally and upgrade the session quota
on demand.

issue #4380
2022-01-19 15:01:05 +01:00
Christian Helmuth
65284b29f8 depot: update recipe hashes 2022-01-19 12:38:13 +01:00
Christian Helmuth
02eea3ecf0 More robust output parsing in ieee754 test
Only parse output of the test programs one-by-one and ignore log
messages from other components not starting with '[init -> test$number]'.

Fixes sporadic failures on KERNEL=sel4 due to the following warning from
core.

  Warning: flush page table entries - mapping cache full - PD: init -> test1
2022-01-19 12:38:13 +01:00
Christian Prochaska
95d9c15607 libc vfs: open OSS 'info' file only once
Issue #4372
2022-01-19 12:38:13 +01:00
Christian Helmuth
b7cf316f24 mesa: exclude .git directory from src archive 2022-01-19 12:38:12 +01:00
Christian Prochaska
33402e407f vfs_oss improvements
Fixes #4375
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
7db602faec os: deprecate platform API for x86, rpi, imx53
* Move platform APIs to "legacy/" subdirectory
* Rename old pc, imx53, and rpi platform_drv
  to "legacy_*_platform_drv"

Fix #4359
2022-01-19 12:38:12 +01:00
Sergey Platonov
ef130a027b libc: fix type handling on socket creation
The socket type (in the lower bits) maybe ORed with SOCK_CLOEXEC and
SOCK_NONBLOCK options (in the higher bits). Currently, supported values
are SOCK_STREAM (1) and SOCK_DGRAM (2), so just take the lower 2 bits.

This fixes treating `SOCK_STREAM` sockets as UDP if additional flags
were set.

Fixes #4370
2022-01-19 12:38:11 +01:00
Sergey Platonov
81acd46518 libc: nameserver file in configured socket directory
The path for the `nameserver` file was fixed to `/socket/nameserver`.
So, if the socket directory was configured differing from `/socket`, DNS
did not work. Now the default path for the `nameserver` takes into
account the path configured in the `socket` libc config attribute.

Fixes #4318
Fixes #4343
2022-01-19 12:35:48 +01:00
Johannes Schlatow
2e1a1c199e lwip plugin: support large backlog values
iperf, e.g., uses INT_MAX as backlog argument to the listen() call

Fixes genodelabs/genode#4341
2022-01-19 12:35:48 +01:00
Josef Söntgen
94a7c32fb4 libports: remove FUSE fs run script snippet
This file is only needed by the FUSE-based file system servers in
the world repository.

Fixes #4353.
2022-01-19 12:35:48 +01:00
Norman Feske
5611fd2355 depot: update recipe hashes 2021-12-17 15:06:38 +01:00
Christian Helmuth
e21ca736b8 fetchurl: remove duplicate from used_apis in recipe 2021-12-17 15:06:38 +01:00
Christian Helmuth
a80a22c819 recipes: don't declare implemented API in used_apis
Prevents "*** detected duplicates in REPOSITORIES" on recipe build.
2021-12-17 15:06:38 +01:00
Stefan Kalkowski
609af0037f liblzma: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f6dd1c96f6 libdrm: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
793a667872 gmp: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
1779cc7a2f freetype: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
86df5b1285 jitterentropy: fix if condition, fix warning
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f5193874c8 e2fsprogs: eliminate warnings, fix strncat bug
Ref #4344
2021-12-17 15:04:48 +01:00
Sebastian Sumpf
0fc2db50f0 ieee754: add test for riscv
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
ee5d300f72 stdcxx: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
a4d67c3262 libm: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
7c976a83e0 libc: riscv support
libc-gen, libc-setjmp, task startup

issue #4312
2021-12-17 15:04:47 +01:00
Norman Feske
dea467f692 libports: avoid implicit conversions
Issue #23
2021-12-17 15:04:47 +01:00
Christian Helmuth
92b7be4d11 depot: update recipe hashes 2021-11-30 12:08:54 +01:00
Josef Söntgen
fcc236d906 libports: add mesa_gpu-etnaviv recipe
Similar to the existing 'mesa_gpu' pkgs add one for 'etnaviv'
as well.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
17da7c88d0 import-libdrm: fix building etnaviv as recipe
Make sure all needed headers are found when building via depot.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
4d93187d31 libdrm: introduce Gpu session for etnaviv
* The Gpu session back end translates all DRM API requests of the
  client into matching Gpu session operations.

* Enable ioctl for etnaviv

Fixes #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
8155505b41 mesa/etnaviv: guard unmapImage call
We may call this function only in case mapImage was successful.

Issue #4329.
2021-11-29 15:11:52 +01:00
Josef Söntgen
d39af2206c mesa_gpu-etnaviv: etnaviv already part of mesa
Since the parts of the 'etnaviv' library are already part of the
'mesa.lib.so' that is normally loaded along-side remove the
duplication here.

Issue #4329.
2021-11-29 15:11:52 +01:00
Norman Feske
dc39a8db62 base: introduce Allocator::try_alloc
This patch changes the 'Allocator' interface to the use of 'Attempt'
return values instead of using exceptions for propagating errors.

To largely uphold compatibility with components using the original
exception-based interface - in particluar use cases where an 'Allocator'
is passed to the 'new' operator - the traditional 'alloc' is still
supported. But it existes merely as a wrapper around the new
'try_alloc'.

Issue #4324
2021-11-29 15:11:52 +01:00
Norman Feske
231ac187fe base: introduce Ram_allocator::try_alloc
This patch replaces the 'Ram_allocator::alloc' RPC function by a
'try_alloc' function, which reflects errors as 'Attempt' return value
instead of an exception.

Issue #4322
Issue #3612
2021-11-29 15:10:53 +01:00
Johannes Schlatow
2ecb09ba7e tool/run: move nic model to qemu_args file
Always instantiating a network device with id `net0`, removes the need to call
append_qemu_nic_args in run scripts unless we want to add forwarding
rules.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Josef Söntgen
6ecae6adb3 qemu-usb: increase USB2/3 root ports to 8 each
In the default setting the number of root ports is set to 4. This
also limits the number of USB host devices that may be attached to
the VM. Since the USB webcam shares the slots, that leaves us with
only 3 available USB2 slots to attach USB host devices. Depending on
the use-case that might not be enough.

This commit statically increases the number of ports to 8 each and
adapts the qemu-usb glue-code accordingly.

Many thanks to Raphael for initial investigation and workaround.

Fixes #4310.
2021-11-29 15:10:51 +01:00
Piotr Tworek
a10903a197 libm: fix undefined __isinff / __isinfl symbol references
Those symbols are not satisfied by any code or dependency of libm. As
result calling cprojf function will always crash on Genode. This crash
can be turned into link time error by adding --no-undefined to LD_OPT.

This patch provides the missing symbols by including isninf.c in libm
build.

Fixes #4299
2021-11-29 15:10:50 +01:00
Christian Helmuth
abc9a2f232 depot: update recipe hashes 2021-10-14 13:46:25 +02:00
Josef Söntgen
9980718c92 libyuv: build unoptimized on ARMv8 2021-10-14 11:46:42 +02:00
Josef Söntgen
2e0d9c8521 libdrm: short-cut tiling in iris back end
Apparently the iris driver does not make use of tiling by the kernel, so
we shortcut the 'SET_TILING' call to keep iris happy with this quickfix.

However, tiling information may get lost, if the iris driver ever calls
'MMAP_GTT' and no fence is configured for the buffer. A follow-up commit
should address this shortcoming in the future.

Issue #4284
2021-10-14 11:40:39 +02:00
Christian Helmuth
4fd2c9c618 libuvc: exclude .git directory from src archive 2021-10-14 11:02:13 +02:00
Norman Feske
a12168e1bb pkg/mesa_gears: display frames per second 2021-10-14 11:02:13 +02:00
Christian Helmuth
d078f7db76 qemu-usb: adapt to webcam capture on/off changes
Issue #4287
2021-10-14 11:02:13 +02:00
Norman Feske
6f1d3862cd base: introduce Env::try_session
The new 'Env::try_session' method mirrors the existing 'Env::session'
without implicitly handling exceptions of the types 'Out_of_ram',
'Out_of_caps', 'Insufficient_ram_quota', and 'Insufficient_cap_quota'.
It enables runtime environments like init to reflect those exceptions to
their children instead of paying the costs of implicit session-quota
upgrades out of the own pocket.

By changing the 'Parent_service' to use 'try_session', this patch fixes
a resource-exhaustion problem of init in Sculpt OS that occurred when
the GPU multiplexer created a large batch of IO_MEM sessions, with each
session requiring a second attempt with the session quota upgraded by
4 KiB.

Issue #3767
2021-10-14 11:02:12 +02:00
Christian Prochaska
b337ee2f2b vfs_oss: fix output fragment limit calculations
Fixes #4289
2021-10-14 11:02:11 +02:00
Norman Feske
eb80d6ce66 usb_webcam: on/off dependent on capture client
This commit removes the report service from the usb_webcam pkg, which
was used to enable or disable the webcam driver. The on/off state is
instead controlled by the presence of a capture client. That is, once a
capture client appears, the webcam driver is started. Vice versa, once
no capture client exists, the webcam driver is removed automatically.

Internally, the detection of presence of a capture client is based on
nitpicker's 'displays' report, which is consumed as input of the
rom_filter, which in turn generates the configuration of a dynamic sub
init.

Fixes #4287
2021-10-14 11:02:10 +02:00
Josef Söntgen
6093f8ad81 gpu/intel: deal with insufficient amount of CAPS
'Out_of_ram' was so far the only exception a client had to deal with
during buffer managment. Allocating memory, however, does not only
consume RAM quota but CAP quota as well.

This commit tries to mitigate that shortcoming by reflecting the
'Out_of_caps' state back to the client. Furthermore it allows for
resource accounting on certain client allocations, e.g. buffers.

Fixes #4284.
2021-10-14 11:02:09 +02:00
Norman Feske
05b451c563 pkg/mesa_gpu: use cached_fs_rom
By using the cached_fs_rom instead of fs_rom, each client obtains the
same (read-only) copy of the shared library, avoiding a RAM resource
request when running mulitple GPU applications at the same time.
With this patch, Sculpt is able to host at least 3 Mesa applications.

Issue #4263
Issue #4281
2021-10-14 11:02:09 +02:00
Norman Feske
8ebc185caf depot: merge rtc_drv into system_clock runtime pkg
This new version of the system_clock pkg does no longer depend on the
presence of an external 'Rtc' service as previously provided by the
Sculpt base system. Instead, it hosts the rtc_drv inside the subsystem.
Because rtc_drv is board-dependent, the system_clock pkg is named
system_clock-pc now.

Issue #4281
2021-10-14 11:02:08 +02:00
Sebastian Sumpf
1072a91592 qemu-usb: disable remote wake up in config descriptors
Some guests don't handle remote wake up correctly causing devices to
stop functioning. Therefore, we disable the remote wake up bit (5) in
`bmAttributes` of the device configuration descriptor.

Thanks to Peter for the initial fix.

Fixes #4278
2021-10-13 14:50:46 +02:00
Josef Söntgen
e6bd9fd7da libc: implement SNDCTL_DSP_GETFMTS ioctl
This I/O control is used to query the audio format, e.g. AFMT_S16_LE
in our case.

Fixes #4276.
2021-10-13 14:50:46 +02:00
Josef Söntgen
f21cf3f8b1 mesa: name driver library appropriately
Rename the 'egl_drv' library and the various back ends to 'mesa_gpu_drv'
and 'mesa_gpu-<backend>'.

Fixes #4275.
2021-10-13 14:50:37 +02:00
Josef Söntgen
cacb83b163 gpu: introduce mapping attributes
The various mapping methods are modelled after the requirements of
the Intel GPUs or rather the Mesa driver back end.

With upcoming support for other driver back ends, we need to
sequeeze their requirements in as well. For now hijack 'map_buffer'
to provide for specifying the kind of attributes the client needs.

For now all buffers mapped in the GGTT for Intel GPUs are treated
as RW.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
90e151e2c4 gpu: add 'complete' RPC call
This call allows for checking if the given execution buffer has been
completed and complements the completion signal. Initially the GPU
multiplexer always sent such a signal when the currently scheduled
execution buffer has been completed. During enablement of the 'iris'
driver it became necessary to properly check of sequence number.

In case of the Intel GPU multiplexer the sequence numbers are
continous, which prompted the greater-than-or-equal check in the
DRM back end. By hidding this implementation detail behind the
interface, GPU drivers are free to deal with sequence numbers any
way they like and allows for polling in the client, where the
completion signal is now more of a progress signal.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
e37792ce94 gpu: introduce information dataspace
The current info implementation (as RPC) is limited in a few ways:

  * The amount of data that may be transferred is constrained by the
    underlying base platform
  * Most information never changes during run time but is copied
    nonetheless
  * The information differs depending on the used GPU device and
    in its current implementation only contains Intel GPU specific
    details

With this commit the 'info' RPC call is replaced with the
'info_dataspace' call that transfers the capability for the dataspace
containing the information only. This is complemented by a client
local 'attached_info' call that allows for getting typed access to
the information. The layout of the information is moved to its own
and GPU-specific header file, e.g., 'gpu/info_intel.h'

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
cfb170c719 gpu: move exec sequence number to Gpu namespace
Moving the type definition removes the aritifial linkage to the Gpu
information structure.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
3b40790e02 gpu: use Buffer_id to identify buffers
Rather than using the dataspace capability directly, let the client
choose its own local identifier that is linked to the underlying
capability.

Fixes #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
ba430dfeac libdrm/iris: destroy Buffer_handle object
When the client frees the buffer, destroy the corresponding
Buffer_handle as well.

Fixes #4266.
2021-10-13 14:46:52 +02:00
Alexander Boettcher
6112c0df6d mesa: rename gpu-* pkg to mesa_gpu-*
for easier linking by user with the Mesa client ROM requests, which will be
mesa_gpu-drv.lib.so. Adjust mesa-gears demo accordingly.

Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
5aa3c56e5c mesa: add gears package
Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
2d2ef2a763 mesa: add gpu-iris package providing IRIS driver
Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
b6beff673a mesa: add gpu-cpu package providing SWRAST driver
Issue #4263
2021-10-13 14:46:51 +02:00
Sebastian Sumpf
07881f90a9 mesa/libdrm: remove signal EP
This is a left over from Mesa-11 and we exchanged it with a
'wait_and_dispatch_one_io_signal' for synchronous signal waits.

issue #4260
2021-10-13 14:46:50 +02:00
Sebastian Sumpf
59b23bc7e1 libdrm: Iris - execute batch buffer synchronous
* Wait for for completion before return from 'execbuffer2'. This makes
  buffer execution synchronous.

* Because the Iris driver manages the virtual address space of the GPU
  and creates one GEM context for each batch buffer we have to map/unmap
  all buffer objects before and after batch buffer execution.

issue #4260
2021-10-13 14:46:50 +02:00
Tomasz Gajewski
e6c915ae06 libssh port: immediate mode for ssh poll
This patch adds a switch to internal poll function in libssh that
allows to force this function to immediately return without actually
polling for data and in consequence processing this data. This switch
is used to avoid calling callback functions when flushing output
streams which caused locks due to recursive access to internal
ssh_terminal sessions registry.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
6ef6f16cb3 libssh port: backported sftp_server_free
sftp_server_free function was added in 0.9 version of libssh and is
required to avoid memory leaks when clients are disconnecting.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
f327a40bbb libssh port: required modifications for sftp
This patch allows to replace sftp packet read and write with
completely asynchronous versions needed to properly hook in existing
ssh_terminal implementation.

Issue #4258
2021-10-13 14:01:02 +02:00
Christian Helmuth
2ba5e4a5b1 libc/oss: check argp per ioctl
... as some ioctls do not require a valid pointer.
2021-10-13 14:01:02 +02:00
Christian Helmuth
83c5648d33 depot: update recipe hashes 2021-08-30 15:00:39 +02:00
Sebastian Sumpf
4782f9376c recipe: Qt5 texedit adjust to new Mesa version
Add dependency to 'libdrm' as it is required by Mesa 21

issue #4254
2021-08-30 15:00:38 +02:00
Christian Prochaska
ece837e8b8 qt5: prepare QtWebEngine sndio backend
Fixes #4257
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
31b049864c qt5_opengl: Disable Vulkan feature
With Mesa-21, Qt5 detects Vulkan to be enabled, even though it is not
supported in Genode. Also add DRM library in Qt5 run script.

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
46be4f1145 mesa_demo: adjust to Mesa 21.0.0
* support argc/argv + double buffering (Alexander Boettcher)
* Route intel/gpu driver to platform driver
* Use Gui session instead of framebuffer session (Josef Söntgen)

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
38d731bd79 libports: Add Mesa-21.0.0 support
* Switch mesa support from DRI to gallium
  Supported drivers are
    - softpipe (Sebstian Sumpf)
    - iris for Intel GPUs (Alexander Boetcher)
    - etnaviv for Vivante GPUs (Josef Söntgen)

* Mesa's generated files are placed into 'contrib/mesa-<hash>/generated'
  and are cloned per default from a separate Git repo in order to avoid
  hash updates upon package build. In case you need to generate files
  yourself use
  ! prepare_port mesa GENERATE_FILES=1

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
9041567f14 libports: Remove Mesa-11.2.2
issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
b6ec4bdf05 libc/stdcxx ABI: symbols for Mesa-21.0.0
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
dd90424129 libports: libdrm-2.4.105 update
Support for iris and etnvaviv

* entaviv:
  - libdrm on FreeBSD is not prepared for !PCI (and libc our is missing
    <sys/pciio.h>
  - missing <sys/types.h> include in xf86drmMode.c
  - etnaviv relies on linux header files - dummy in $(INC_DIR)
  - IOCTL FreeBSD ↔ Linux have swapped IO/OUT bit
  - O_CLOEXEC differs between FreeBSD ↔ Linux

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
c26c50e59b libports: remove libdrm 2.4.21
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
ac9e0947fd libc: add HM_REALMEM sysctl
Used by Mesa in the Gallium etnaviv driver.

issue #4254
2021-08-30 15:00:37 +02:00
Josef Söntgen
fb4d357b59 libc: pull in sys/pciio.h
This header is needed by recent versions of libdrm that feature
FreeBSD support.

issue #4254
2021-08-30 15:00:37 +02:00
Christian Prochaska
149bd999f3 vfs_oss: support more commands for VirtualBox 6 and sndio
Fixes #4252
2021-08-30 15:00:36 +02:00
Christian Helmuth
7618c9410a depot: update recipe hashes 2021-08-18 15:06:12 +02:00
Martin Stein
fa64aae7f8 nic_router: config attribute 'dns_config_from'
WARNING: BREAKS CONFIG COMPATIBILITY!

This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

How to adjust:
At each occurrence of the 'dns_server_from' attribute in a NIC router
configuration replace the attribute name with 'dns_config_from'. The attribute
value remains unaltered.

DETAILED DESCRIPTION

The new attribute name 'dns_config_from' reflects that also other aspects of
the DNS configuration of the denominated domain are used by the DHCP server
that holds the attribute. This commit is a preparation for forwarding also the
domain name (DHCP option 15) with the mechanism behind the attribute.

Ref #4246
2021-08-18 15:06:12 +02:00
Martin Stein
e648e7255a nic_router: optional icmp type 3 on fragm. ipv4
Via a new configuration attribute, the user can decide whether the router
should answer dropped fragmented IPv4 with an ICMP "destination unreachable"
packet and, if so, which value the ICMP code field of this packet should have.
The default is that the router doesn't send such responses (silently dropping
fragmented IPv4). The behavior is tested by the 'nic_router_ipv4_fragm' test.

Fixes #4236
2021-08-18 15:06:12 +02:00
Martin Stein
06a4608f4a nic_router: report dropped fragmented IPv4
If the new attribute 'dropped_fragm_ipv4' of the <report> tag in the NIC router
config is set "yes", the router will report the number of packets that were
dropped per interface respectively domain because fragmented IPv4 is not
supported. The default is not to report the counter. The behavior is tested by
the 'nic_router_ipv4_fragm' test.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
619474bc90 nic_router: drop fragmented IPv4
The NIC router used to ignore the IPv4 header fields "More fragments" and
"Fragment offset" completely. Therefore higher-level protocols of fragmented
IPv4 were interpreted wrong because each fragment was considered a self-
standing packet, expecting, for instance UDP/TCP headers somewhere inside of
the UDP/TCP data field. Normally, such packets were dropped as soon as the
UDP/TCP checksum check failed because of the misinterpretation. However,
it was also possible for fragmented IPv4 to pass the router although normally
only partially.

IPv4 fragmentation support in the router would introduce some potential
security risks and is presumably not an easy endeavor. So, for now, we settled
on not supporting IPv4 fragmentation. With this commit, the router simply drops
all fragmented IPv4. This is reflected to the log for each fragment as "drop
packet (fragmented IPv4 not supported)" when 'verbose_packet_drop="yes"' is
configured.

The new test 'run/nic_router_ipv4_fragm' is an automated test for this
behavior. The test is added to the autopilot list.

Ref #4236
2021-08-18 15:06:12 +02:00
Christian Prochaska
d7a27c448d qt5: implement 'CancelableSyncSocket::Shutdown()'
Fixes #4239
2021-08-18 15:06:12 +02:00
Martin Stein
626b2f9cf2 run/libc_vfs_fs_fat: add to autopilot
Excludes board 'virt_qemu' from the test as we don't have block device drivers
for this board.

Ref #4220
2021-08-18 15:06:12 +02:00