mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 17:50:16 +01:00
The BPF filter takes the byte containing IP Flags and performs a
bitwise AND with "ntohs(IP_MF | IP_OFFMASK)".
On little-endian architectures the IP_MF flag (0x20) is ANDed with
0xFF3F and so the presence of the flag is correctly detected ignoring
other flags as IP_DF (0x40) or IP_RF (0x80).
On big-endian, "ntohs(IP_MF | IP_OFFMASK)" is 0x3FFF and so the filter
wrongly checks the presence of *any* flags. Therefore, a packet with
the DF flag set is dropped.
Instead, take the two bytes containing flags and offset:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
and verify that IP_MF and the offset are zero.
Fixes:
|
||
|---|---|---|
| .. | ||
| .github/workflows | ||
| src | ||
| subprojects | ||
| .editorconfig | ||
| .gitmodules | ||
| AUTHORS | ||
| meson.build | ||
| NEWS.md | ||
| README.md | ||
n-dhcp4
Dynamic Host Configuration Protocol for IPv4
The n-dhcp4 project implements the IPv4 Dynamic Host Configuration Protocol as defined in RFC-2132+.
Project
- Website: https://nettools.github.io/n-dhcp4
- Bug Tracker: https://github.com/nettools/n-dhcp4/issues
- Mailing-List: https://groups.google.com/forum/#!forum/nettools-devel
Requirements
The requirements for this project are:
Linux kernel >= 3.19libc(e.g.,glibc >= 2.16)
At build-time, the following software is required:
meson >= 0.41pkg-config >= 0.29
Build
The meson build-system is used for this project. Contact upstream documentation for detailed help. In most situations the following commands are sufficient to build and install from source:
mkdir build
cd build
meson setup ..
ninja
meson test
ninja install
No custom configuration options are available.
Repository:
- web: https://github.com/nettools/n-dhcp4
- https:
https://github.com/nettools/n-dhcp4.git - ssh:
git@github.com:nettools/n-dhcp4.git
License:
- Apache-2.0 OR LGPL-2.1-or-later
- See AUTHORS file for details.