Age | Commit message (Collapse) | Author |
|
Timers attach themselves to the provided parent, so they are safely kept
alive.
|
|
|
|
Also add slightly richer parse errors now that we can include a string
literal with returned errors.
This will allow us to use TRY() when working with JSON data.
|
|
|
|
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
|
|
Instead of creating a temporary ByteBuffer to hold the packet while
building it, we can just create the DHCPv4Packet struct directly.
|
|
|
|
This adds component declarations so that users can select to not build
certain parts of the OS.
|
|
Just casting a void* to a T* and dereferencing it is not particularly
safe. Also UBSAN was complaining. Use memcpy into a default constructed
T instead and require that the T be trivially copyable.
|
|
Public members shouldn't have an "m_" prefix.
|
|
|
|
Previously we'd only only send one DHCP request for network interfaces
which were up when DHCPClient started. If that packet was lost we'd
never send another request for those interfaces.
Also, if an interface were to appear after DHCPClient started (not
that that is possible at the moment) we wouldn't send requests for
that interface either.
|
|
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
|
|
...and make it an enum class so people don't omit "OpenMode".
|
|
|
|
|
|
We had some inconsistencies before:
- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."
I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.
By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
Calling memcpy with null pointers results in undefined behaviour, even
if count is zero.
This in turns is exploited by GCC. For example, the following code:
memcpy (dst, src, n);
if (!src)
return;
src[0] = 0xcafe;
will be optimized as:
memcpy (dst, src, n);
src[0] = 0xcafe;
IOW the test for NULL is gone.
|
|
Attempts are spaced out with exponential backoff, cut at 10 minutes per
attempt.
Also avoid trying to acquire an IP on interfaces that aren't up.
Fixes #6126.
Fixes #6125.
|
|
Real DHCP servers might decide to send the DHCPAck directly to the
specified ciaddr instead of as a unicast or multicast, resulting in
the ack being ignored by the network adapter when we are requesting
a new IPv4 address instead of renewing an existing lease, as the
yiaddr (and as a result the ciaddr) is set to the offered address in
that case instead of the current ip address.
|
|
Some real DHCP servers dont set the siaddr field in the DHCPOffer to
their IPv4 (and instead leave it blank - 0.0.0.0), which results in
the server assuming the DHCPRequest is not directed at him when it
has the ServerIdentifier option attached that specifies 0.0.0.0 as
the targeted server. So instead we just omit the option and let the
DHCP servers decipher the target themselves based on the requested IP.
|
|
The current parsing code assumed the ascii lowercase letters came after
the ascii numbers, which is not the case, and as such corrupted any mac
address that included hex letters (a-f). We likely did not notice this
as QEMU's emulated MAC is made up of only hex digits.
|
|
Good-bye LogStream. Long live AK::Format!
|
|
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
We were using unseeded rand() for the XID, which meant that our DHCP
XID's were 100% predictable.
Switch to using AK::get_random<u32>() instead. :^)
|
|
|
|
Some dhcp servers require these to be there - otherwise, the ack gets
dropped somewhere.
|
|
This is the field that tells the DHCP server which IP we want, not
setting it is quite silly :P
|
|
It's acceptable to have less padding in a packet, the only requirement
is to have a single byte of 'END' in the DHCP fields.
|
|
This is supposed to be the MSB, not the LSB.
|
|
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
|
|
This was done with the following script:
find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \;
find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
|
|
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
|
|
|
|
|