#
3ae7c763 |
| 02-Mar-2025 |
Zhenlei Huang <zlei@FreeBSD.org> |
netinet: Make in_canforward() return bool
No functional change intended.
MFC after: 5 days
|
#
97309cec |
| 27-Feb-2025 |
Zhenlei Huang <zlei@FreeBSD.org> |
netinet: Make in_ifhasaddr() return bool
No functional change intended.
MFC after: 1 week
|
#
69beb162 |
| 27-Feb-2025 |
Zhenlei Huang <zlei@FreeBSD.org> |
netinet: Make in_localaddr() return bool
It is used as a boolean function everywhere.
No functional change intended.
MFC after: 1 week
|
#
f510c5b2 |
| 24-Feb-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
netinet: fix build
Fixes: 3b281d1421a78b588c5fc4182009ce62d8823d95
|
#
3b281d14 |
| 22-Feb-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
netinet: enforce broadcast mode for all-ones and all-zeroes destinations
When a socket has SO_BROADCAST set and destination address is INADDR_ANY or INADDR_BROADCAST, the kernel shall pick up first
netinet: enforce broadcast mode for all-ones and all-zeroes destinations
When a socket has SO_BROADCAST set and destination address is INADDR_ANY or INADDR_BROADCAST, the kernel shall pick up first broadcast capable interface and broadcast the packet out of it. Since this API is not reliable on a machine with > 1 broadcast capable interfaces, all practical software seems to use IP_ONESBCAST or other mechanisms to send broadcasts. This has been broken at least since FreeBSD 6.0, see bug 99558. Back then the problem was in the fact that in_broadcast() check was always done against the gateway address, not the destination address. Later, with 90cc51a1ab4be, a second problem piled on top - we aren't checking for INADDR_ANY and INADDR_BROADCAST at all.
Better late than never, fix that by checking destination address.
PR: 99558 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49042
show more ...
|
#
197fc4ca |
| 22-Feb-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
netinet: rename in_broadcast() to in_ifnet_broadcast()
This aligns with existing in_ifaddr_broadcast() and aligns with other simple functions or macros with bare "in_" prefix that operator just on s
netinet: rename in_broadcast() to in_ifnet_broadcast()
This aligns with existing in_ifaddr_broadcast() and aligns with other simple functions or macros with bare "in_" prefix that operator just on struct in_addr and nothing else, e.g. in_nullhost(). No functional change.
Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49041
show more ...
|
Revision tags: release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4 |
|
#
dc9db1f6 |
| 18-Feb-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
netinet: make in_broadcast() and in_ifaddr_broadcast return bool
While here annotate deprecated condition with __predict_false() and slightly refactor in_broadcast() removing leftovers from old addr
netinet: make in_broadcast() and in_ifaddr_broadcast return bool
While here annotate deprecated condition with __predict_false() and slightly refactor in_broadcast() removing leftovers from old address list locking. Should be no functional change.
show more ...
|
Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0 |
|
#
29363fb4 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
2ff63af9 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
|
Revision tags: release/13.2.0 |
|
#
317fa516 |
| 28-Feb-2023 |
Mark Johnston <markj@FreeBSD.org> |
netinet: Remove the IP(V6)_RSS_LISTEN_BUCKET socket option
It has no effect, and an exp-run revealed that it is not in use.
PR: 261398 (exp-run) Reviewed by: mjg, glebius Sponsored by: Klara, Inc.
netinet: Remove the IP(V6)_RSS_LISTEN_BUCKET socket option
It has no effect, and an exp-run revealed that it is not in use.
PR: 261398 (exp-run) Reviewed by: mjg, glebius Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38822
show more ...
|
#
3aff4ccd |
| 27-Feb-2023 |
Mark Johnston <markj@FreeBSD.org> |
netinet: Remove IP(V6)_BINDMULTI
This option was added in commit 0a100a6f1ee5 but was never completed. In particular, there is no logic to map flowids to different listening sockets, so it accomplis
netinet: Remove IP(V6)_BINDMULTI
This option was added in commit 0a100a6f1ee5 but was never completed. In particular, there is no logic to map flowids to different listening sockets, so it accomplishes basically the same thing as SO_REUSEPORT. Meanwhile, we've since added SO_REUSEPORT_LB, which at least tries to balance among listening sockets using a hash of the 4-tuple and some optional NUMA policy.
The option was never documented or completed, and an exp-run revealed nothing using it in the ports tree. Moreover, it complicates the already very complicated in_pcbbind_setup(), and the checking in in_pcbbind_check_bindmulti() is insufficient. So, let's remove it.
PR: 261398 (exp-run) Reviewed by: glebius Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38574
show more ...
|
Revision tags: release/12.4.0 |
|
#
24b96f35 |
| 04-Oct-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
netinet*: move ipproto_register() and co to ip_var.h and ip6_var.h
This is a FreeBSD KPI and belongs to private header not netinet/in.h.
Reviewed by: melifaro Differential revision: https://review
netinet*: move ipproto_register() and co to ip_var.h and ip6_var.h
This is a FreeBSD KPI and belongs to private header not netinet/in.h.
Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36723
show more ...
|
#
78b1fc05 |
| 17-Aug-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
protosw: separate pr_input and pr_ctlinput out of protosw
The protosw KPI historically has implemented two quite orthogonal things: protocols that implement a certain kind of socket, and protocols t
protosw: separate pr_input and pr_ctlinput out of protosw
The protosw KPI historically has implemented two quite orthogonal things: protocols that implement a certain kind of socket, and protocols that are IPv4/IPv6 protocol. These two things do not make one-to-one correspondence. The pr_input and pr_ctlinput methods were utilized only in IP protocols. This strange duality required IP protocols that doesn't have a socket to declare protosw, e.g. carp(4). On the other hand developers of socket protocols thought that they need to define pr_input/pr_ctlinput always, which lead to strange dead code, e.g. div_input() or sdp_ctlinput().
With this change pr_input and pr_ctlinput as part of protosw disappear and IPv4/IPv6 get their private single level protocol switch table ip_protox[] and ip6_protox[] respectively, pointing at array of ipproto_input_t functions. The pr_ctlinput that was used for control input coming from the network (ICMP, ICMPv6) is now represented by ip_ctlprotox[] and ip6_ctlprotox[].
ipproto_register() becomes the only official way to register in the table. Those protocols that were always static and unlikely anybody is interested in making them loadable, are now registered by ip_init(), ip6_init(). An IP protocol that considers itself unloadable shall register itself within its own private SYSINIT().
Reviewed by: tuexen, melifaro Differential revision: https://reviews.freebsd.org/D36157
show more ...
|
#
efe58855 |
| 24-May-2022 |
Mike Karels <karels@FreeBSD.org> |
IPv4: experimental changes to allow net 0/8, 240/4, part of 127/8
Combined changes to allow experimentation with net 0/8 (network 0), 240/4 (Experimental/"Class E"), and part of the loopback net 127
IPv4: experimental changes to allow net 0/8, 240/4, part of 127/8
Combined changes to allow experimentation with net 0/8 (network 0), 240/4 (Experimental/"Class E"), and part of the loopback net 127/8 (all but 127.0/16). All changes are disabled by default, and can be enabled by the following sysctls:
net.inet.ip.allow_net0=1 net.inet.ip.allow_net240=1 net.inet.ip.loopback_prefixlen=16
When enabled, the corresponding addresses can be used as normal unicast IP addresses, both as endpoints and when forwarding.
Add descriptions of the new sysctls to inet.4.
Add <machine/param.h> to vnet.h, as CACHE_LINE_SIZE is undefined in various C files when in.h includes vnet.h.
The proposals motivating this experimentation can be found in
https://datatracker.ietf.org/doc/draft-schoen-intarea-unicast-0 https://datatracker.ietf.org/doc/draft-schoen-intarea-unicast-240 https://datatracker.ietf.org/doc/draft-schoen-intarea-unicast-127
Reviewed by: rgrimes, pauamma_gundo.com; previous versions melifaro, glebius Differential Revision: https://reviews.freebsd.org/D35741
show more ...
|
Revision tags: release/13.1.0, release/12.3.0 |
|
#
9c89392f |
| 12-Nov-2021 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Add in_localip_fib(), in6_localip_fib().
Check if given address/FIB exists locally.
Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D32913
|
#
20d59403 |
| 27-Oct-2021 |
Mike Karels <karels@FreeBSD.org> |
kernel: deprecate Internet Class A/B/C
Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined; define it for user level. Define IN_MULTICAST separately from IN_CLASSD, and use it i
kernel: deprecate Internet Class A/B/C
Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined; define it for user level. Define IN_MULTICAST separately from IN_CLASSD, and use it in pf instead of IN_CLASSD. Stop using class for setting default masks when not specified; instead, define new default mask (24 bits). Warn when an Internet address is set without a mask.
MFC after: 1 month Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D32708
show more ...
|
#
c8ee75f2 |
| 10-Oct-2021 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Use network epoch to protect local IPv4 addresses hash.
The modification to the hash are already naturally locked by in_control_sx. Convert the hash lists to CK lists. Remove the in_ifaddr_rmlock.
Use network epoch to protect local IPv4 addresses hash.
The modification to the hash are already naturally locked by in_control_sx. Convert the hash lists to CK lists. Remove the in_ifaddr_rmlock. Assert the network epoch where necessary.
Most cases when the hash lookup is done the epoch is already entered. Cover a few cases, that need entering the epoch, which mostly is initial configuration of tunnel interfaces and multicast addresses.
Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D32584
show more ...
|
#
4b631fc8 |
| 07-Sep-2021 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: fix source address selection rules for IPv4 over IPv6.
Current logic always selects an IFA of the same family from the outgoing interfaces. In IPv4 over IPv6 setup there can be just singl
routing: fix source address selection rules for IPv4 over IPv6.
Current logic always selects an IFA of the same family from the outgoing interfaces. In IPv4 over IPv6 setup there can be just single non-127.0.0.1 ifa, attached to the loopback interface.
Create a separate rt_getifa_family() to handle entire ifa selection for the IPv4 over IPv6.
Differential Revision: https://reviews.freebsd.org/D31868 MFC after: 1 week
show more ...
|
Revision tags: release/13.0.0, release/12.2.0 |
|
#
868aabb4 |
| 09-Oct-2020 |
Richard Scheffenegger <rscheff@FreeBSD.org> |
Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow.
This adds a new IP_PROTO / IPV6_PROTO setsockopt (getsockopt) option IP(V6)_VLAN_PCP, which can be set to -1 (interface default), or explicitly to
Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow.
This adds a new IP_PROTO / IPV6_PROTO setsockopt (getsockopt) option IP(V6)_VLAN_PCP, which can be set to -1 (interface default), or explicitly to any priority between 0 and 7.
Note that for untagged traffic, explicitly adding a priority will insert a special 801.1Q vlan header with vlan ID = 0 to carry the priority setting
Reviewed by: gallatin, rrs MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26409
show more ...
|
Revision tags: release/11.4.0 |
|
#
44e86fbd |
| 13-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357662 through r357854.
|
#
481be5de |
| 12-Feb-2020 |
Randall Stewart <rrs@FreeBSD.org> |
White space cleanup -- remove trailing tab's or spaces from any line.
Sponsored by: Netflix Inc.
|
Revision tags: release/12.1.0 |
|
#
deb2aead |
| 08-Aug-2019 |
Tom Jones <thj@FreeBSD.org> |
Rename IPPROTO 33 from SEP to DCCP
IPPROTO 33 is DCCP in the IANA Registry: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
IPPROTO_SEP was added about 20 years ago in r338
Rename IPPROTO 33 from SEP to DCCP
IPPROTO 33 is DCCP in the IANA Registry: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
IPPROTO_SEP was added about 20 years ago in r33804. The entries were added straight from RFC1700, without regard to whether they were used.
The reference in RFC1700 for SEP is '[JC120] <mystery contact>', this is an indication that the protocol number was probably in use in a private network.
As RFC1700 is no longer the authoritative list of internet numbers and that IANA assinged 33 to DCCP in RFC4340, change the header to the actual authoritative source.
Reviewed by: Richard Scheffenegger, bz Approved by: bz (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21178
show more ...
|
Revision tags: release/11.3.0 |
|
#
7f49ce7a |
| 28-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349476
Sponsored by: The FreeBSD Foundation
|
#
59854ecf |
| 25-Jun-2019 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Convert all IPv4 and IPv6 multicast memberships into using a STAILQ instead of a linear array.
The multicast memberships for the inpcb structure are protected by a non-sleepable lock, INP_WLOCK(), w
Convert all IPv4 and IPv6 multicast memberships into using a STAILQ instead of a linear array.
The multicast memberships for the inpcb structure are protected by a non-sleepable lock, INP_WLOCK(), which needs to be dropped when calling the underlying possibly sleeping if_ioctl() method. When using a linear array to keep track of multicast memberships, the computed memory location of the multicast filter may suddenly change, due to concurrent insertion or removal of elements in the linear array. This in turn leads to various invalid memory access issues and kernel panics.
To avoid this problem, put all multicast memberships on a STAILQ based list. Then the memory location of the IPv4 and IPv6 multicast filters become fixed during their lifetime and use after free and memory leak issues are easier to track, for example by: vmstat -m | grep multi
All list manipulation has been factored into inline functions including some macros, to easily allow for a future hash-list implementation, if needed.
This patch has been tested by pho@ .
Differential Revision: https://reviews.freebsd.org/D20080 Reviewed by: markj @ MFC after: 1 week Sponsored by: Mellanox Technologies
show more ...
|
Revision tags: release/12.0.0, release/11.2.0 |
|
#
82725ba9 |
| 23-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325999 through r326131.
|