Commit Graph
14 Commits
Author SHA1 Message Date
Christof Meerwald 5fed29dcb0 IPv6: implement multicast support
* Copied and adapted deliver_multicast from IPv4

* However, we still need special handling for the Neighbor Discovery
  Protocol as there is no associated socket. So for now we just pass
  any multicast ICMPv6 packets to the ICMPv6 module's receive_data
  that in turn passes it to the NDP module.

Change-Id: Idc9db0ec2132dffcf65c3b767dd1e428c44b27ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10169
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-01-08 20:17:42 +00:00
Christof Meerwald 68c1d4b3a8 IPv6: Path MTU Discovery
* Copied and adapted IPv4 error handling code for IPv6 (to handle
  ICMP6_PACKET_TOO_BIG)

Change-Id: Id14cf6221626b5c723fbe77f19aa0d6b9d25f36a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10170
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-01-06 21:25:16 +00:00
Christof Meerwald f7598f6461 IPv6: Fix cache update when receiving neighbor solicitation
* For a received neighbor solicitation, the target address would be
  our local address, so we need to use the IPv6 source address instead.

Change-Id: I93af830c04354e069c3c43f05e28a3cf3cd5dd9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10178
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-02 09:13:12 +00:00
Christof Meerwald fdea8f3939 netstat: Added support for displaying IPv6 addresses and fixed filtering
* Previously, the filtering logic didn't work at all.

* netstat can now also display IPv6 addresses (mainly by using
  getnameinfo instead of using IPv4 specific functions).

* Removed dead code.

Change-Id: Iaafe3d57253a64ef12ed79d7968e8fd1dfcb3960
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10180
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-01-02 09:12:53 +00:00
Christof Meerwald babc1f216f telnet: Enable IPv6 support
* Define INET6 when compiling telnet and telnetd

Change-Id: Ic79c6001b6b8381ec00ae93a44304fd52d84eccb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10179
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-01-02 09:12:15 +00:00
Christof Meerwald c8ebd7dde0 resolv: Zero-initialize res_state objects.
Import fix from NetBSD PR lib/58888

This could have leaked data to the resolver or resulted in the resolver
returning incorrect results.

Change-Id: Idedb9d12c8ad7a88f0e5e05e735efdd8c914cbde
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10149
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-12-23 16:56:19 +00:00
Christof Meerwald 09115ce009 build: Fix NetBSD build issues
* Use LITTLE_ENDIAN instead of __LITTLE_ENDIAN (LITTLE_ENDIAN is what
  POSIX now specifies and everyone seems to define - NetBSD also
  defines _LITTLE_ENDIAN, but not __LITTLE_ENDIAN)

* file descriptors greater than 2 must be explicitly passed to a child
  on NetBSD. POSIX leaves that unspecified, see
  https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#exec

* system library functions get declared with visibility "default" on
  NetBSD, so a "hidden" visibility attribute is ignored on a
  redeclaration. Work around by putting the functions in a namespace -
  as they are extern "C", they still end up in the object file without
  the namespace qualifier.

* remove the cast on the NULL pointer on the funopen call - it's not
  needed and the types are different between FreeBSD (fpos_t) and
  NetBSD/OpenBSD (off_t); also trying to change that upstream
  https://github.com/openSUSE/libsolv/pull/603

Change-Id: I6ab7f3c74d18960d7589b403a1c219cdac85a453
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10133
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-12-23 09:01:45 +00:00
Christof Meerwald d29137917a build: Add NetBSD as a host platform
* NetBSD is very similar to FreeBSD

* there is no libdl on NetBSD

* packages live in /usr/pkg on NetBSD

* the argument to tolower() must be representable as an unsigned char

Change-Id: Icff569c4472f7e91edd0ce6d489affb04babde7c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10130
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-12-19 17:45:22 +00:00
Christof Meerwald def75fa413 libroot: Don't call pipe2 from pipe
Calling pipe2 from pipe is problematic in cases where a program
implements its own pipe2 emulation, see
https://discuss.haiku-os.org/t/emacs-not-starting/16125/13

Change-Id: I317946fd95b98671d382c09ccd6fff2600f9e75b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8768
Reviewed-by: waddlesplash <[email protected]>
2025-01-03 20:20:14 +00:00
Christof Meerwald 0ab42081b5 kernel/network: Limit send MSS by interface MTU
see RFC9293 3.7.1. Maximum Segment Size Option

  The maximum size of a segment that a TCP endpoint really sends, the
  "effective send MSS", MUST be the smaller of the send MSS (that
  reflects the available reassembly buffer size at the remote host)
  and the largest transmission size permitted by the IP layer.

Previously, instead of just choosing a lower send MSS, we would
(try to) fragment those packets.

With this change I now get a 10/10 score from test-ipv6.com when
setting the local MTU to 1280 (this is needed as a workaround as we
don't implement Path MTU Discovery).

Change-Id: I27bdfebe2f94a55951407136ab7c4dd9626cdcea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6043
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2023-01-30 12:11:29 +00:00
Christof Meerwald 3554137fa9 network: Always add default route after setting IP address
Previously, a default route was only added if the interface was not
set for auto configuration and it was added before the address was
configured. Currently, using DHCP for IPv4 means that the interface is
set as auto-configured (i.e. this also meant that the statically
configured default route for IPv6 wasn't even attempted to be added).
Also, adding a default route when the address hasn't been set is
questionable.

Always adding a default route (if a gateway is configured) shouldn't
cause any issues, even for auto-configuration cases, as the default
route will just be replaced once auto-configuration has completed
(which already happens for the IP address).

This change fixes network configuration where IPv6 is statically
configured and IPv4 is either also statically configured or
auto-configured.

Change-Id: I6b268ab1fa89777c64e1396cc460444f49edfef9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6039
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-01-28 20:05:30 +00:00
Christof Meerwald 64a48a5521 kernel/network: Fix neighbor advertisement hoplimit
All neighbor discovery messages need to be sent with a hop limit of
255, but some messages, like solicited neighbor advertisements, are
unicast messages. So need to set the hop limit for both multicast and
unicast messages.

Fixes #14562

Change-Id: I84fba8acbb5833c65d6113c8a7e0cc821a706881
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6038
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2023-01-28 09:53:06 +00:00
Christof Meerwald 88864ff1f9 kernel/network: Reply with a ICMPv6 neighbor advertisment
Send a neighbor advertisment when we have received a neighbor
solicitation.

Change-Id: Ie552a8e81d3f06b2dbfaab83ad5a30bac8962224
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6037
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-01-27 09:10:11 +00:00
Christof Meerwald 62ee13a983 kernel/network: Fix ICMPv6 checksum calculation
Ensure that any overflow bits aren't lost when returning from the
helper function. These need to added to the least significant bits in
ipv6_checksum.

Change-Id: Ida9821dd87d34ac1982703d9861419ed97ab4b9e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6036
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-01-27 09:10:11 +00:00