History log of /dflybsd-src/sys/netinet/raw_ip.c (Results 1 – 25 of 86)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# fb1dde20 10-Nov-2023 Aaron LI <aly@aaronly.me>

kernel: No need to handle mbuf allocation failures if use M_WAITOK


# 2b3f93ea 13-Oct-2023 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Add per-process capability-based restrictions

* This new system allows userland to set capability restrictions which
turns off numerous kernel features and root accesses. These restricti

kernel - Add per-process capability-based restrictions

* This new system allows userland to set capability restrictions which
turns off numerous kernel features and root accesses. These restrictions
are inherited by sub-processes recursively. Once set, restrictions cannot
be removed.

Basic restrictions that mimic an unadorned jail can be enabled without
creating a jail, but generally speaking real security also requires
creating a chrooted filesystem topology, and a jail is still needed
to really segregate processes from each other. If you do so, however,
you can (for example) disable mount/umount and most global root-only
features.

* Add new system calls and a manual page for syscap_get(2) and syscap_set(2)

* Add sys/caps.h

* Add the "setcaps" userland utility and manual page.

* Remove priv.9 and the priv_check infrastructure, replacing it with
a newly designed caps infrastructure.

* The intention is to add path restriction lists and similar features to
improve jailess security in the near future, and to optimize the
priv_check code.

show more ...


# 2ba12c9c 09-Jul-2023 Matthew Dillon <dillon@apollo.backplane.com>

network - Remove ip_len header-length adjustment

* This should remove the last main code path modifications to packet
mbuf contents. The IP header in the mbuf is now basically left alone
whenev

network - Remove ip_len header-length adjustment

* This should remove the last main code path modifications to packet
mbuf contents. The IP header in the mbuf is now basically left alone
whenever possible, bringing us in-line with FreeBSD and Linux and
removing cache-line bounces between cpus and between a cpu and the
related PCIe DMA.

* Do not adjust ip_len to remove the IP header length.

* Various protocol stacks do the subtraction themselves, when needed.

* Various bits of code that added the length back in to execute a function
then removed it again cleaned up.

* IP reassembly (in ip_input.c and pf_norm.c) cleaned up.

show more ...


# 8a93af2a 08-Jul-2023 Matthew Dillon <dillon@apollo.backplane.com>

network - Remove host-order translations of ipv4 ip_off and ip_len

* Do not translate ip_off and ip_len to host order and then back again
in the network stack. The fields are now left in network

network - Remove host-order translations of ipv4 ip_off and ip_len

* Do not translate ip_off and ip_len to host order and then back again
in the network stack. The fields are now left in network order.

show more ...


Revision tags: v6.4.0, v6.4.0rc1, v6.5.0, v6.2.2, v6.2.1, v6.3.0, v6.0.1, v6.0.0, v6.0.0rc1, v6.1.0, v5.8.3, v5.8.2, v5.8.1, v5.8.0, v5.9.0, v5.8.0rc1, v5.6.3
# f14c36b5 10-Sep-2019 Roy Marples <roy@marples.name>

inet: unhook and remove rip_ctlinput

This is no longer needed thanks to rt_purgecloned.
This also fixes two problems where we would lie about the address
being removed via RTM_DELADDR and the assump

inet: unhook and remove rip_ctlinput

This is no longer needed thanks to rt_purgecloned.
This also fixes two problems where we would lie about the address
being removed via RTM_DELADDR and the assumption that the
subnet route should be removed / moved to another interface.

show more ...


Revision tags: v5.6.2
# 7eaeff3d 07-Aug-2019 Roy Marples <roy@marples.name>

socket: introduce SO_RERROR to detect receive buffer overflow

kernel receive buffers are initially of a limited size and
generally the network protocols that use them don't care
if a packet gets los

socket: introduce SO_RERROR to detect receive buffer overflow

kernel receive buffers are initially of a limited size and
generally the network protocols that use them don't care
if a packet gets lost.

However some users do care about lost messages even if not
baked into the protocol - such as consumers of route(4) to
track state.

POSIX states that read(2) can return an error of ENOBUFS so
return this error code when an overflow is detected.
Guard this with socket option SO_RERROR so that existing
applications which do not care can carry on not caring by
default.

Taken-from: NetBSD
Reviewed-by: sephe

show more ...


Revision tags: v5.6.1, v5.6.0, v5.6.0rc1, v5.7.0, v5.4.3, v5.4.2
# fcf6efef 02-Mar-2019 Sascha Wildner <saw@online.de>

kernel: Remove numerous #include <sys/thread2.h>.

Most of them were added when we converted spl*() calls to
crit_enter()/crit_exit(), almost 14 years ago. We can now
remove a good chunk of them agai

kernel: Remove numerous #include <sys/thread2.h>.

Most of them were added when we converted spl*() calls to
crit_enter()/crit_exit(), almost 14 years ago. We can now
remove a good chunk of them again for where crit_*() are
no longer used.

I had to adjust some files that were relying on thread2.h
or headers that it includes coming in via other headers
that it was removed from.

show more ...


Revision tags: v5.4.1, v5.4.0, v5.5.0, v5.4.0rc1, v5.2.2, v5.2.1
# 755d70b8 21-Apr-2018 Sascha Wildner <saw@online.de>

Remove IPsec and related code from the system.

It was unmaintained ever since we inherited it from FreeBSD 4.8.

In fact, we had two implementations from that time: IPSEC and FAST_IPSEC.
FAST_IPSEC

Remove IPsec and related code from the system.

It was unmaintained ever since we inherited it from FreeBSD 4.8.

In fact, we had two implementations from that time: IPSEC and FAST_IPSEC.
FAST_IPSEC is the implementation to which FreeBSD has moved since, but
it didn't even build in DragonFly.

Fixes for dports have been committed to DeltaPorts.

Requested-by: dillon
Dports-testing-and-fixing: zrj

show more ...


Revision tags: v5.2.0, v5.3.0, v5.2.0rc, v5.0.2, v5.0.1, v5.0.0, v5.0.0rc2, v5.1.0, v5.0.0rc1
# d938108c 07-Sep-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

ipfw: Add per-cpu table support.

This is intended to improve performance and reduce latency for
matching discrete addresses. Table itself is radix tree.

For exmaple, nginx, 1KB web object, 30K con

ipfw: Add per-cpu table support.

This is intended to improve performance and reduce latency for
matching discrete addresses. Table itself is radix tree.

For exmaple, nginx, 1KB web object, 30K concurrent connections,
1 request/connection. ipfw is running on the server side.

Comparison between no-match rules and no-match table entries:

| perf-avg | lat-avg | lat-stdev | lat-99%
| (tps) | (ms) | (ms) | (ms)
-------------------+-----------+---------+-----------+---------
100 nomatch rules | 184752.65 | 67.50 | 5.69 | 79.11
-------------------+-----------+---------+-----------+---------
100 nomatch tblent | 200754.53 | 61.18 | 5.72 | 73.10

1K nomatch rules | 90836.43 | 144.72 | 12.28 | 168.97
-------------------+-----------+---------+-----------+---------
1K nomatch tblent | 199750.35 | 61.54 | 5.73 | 72.90

10K nomatch rules | 14836.69 | 864.46 | 157.49 | 1110.00
-------------------+-----------+---------+-----------+---------
10K nomatch tblent | 198412.93 | 62.17 | 5.66 | 73.08

Comparison between number of no-match table entries:

| perf-avg | lat-avg | lat-stdev | lat-99%
| (tps) | (ms) | (ms) | (ms)
-------------------+-----------+---------+-----------+---------
no-ipfw | 210658.80 | 58.01 | 5.20 | 68.73
-------------------+-----------+---------+-----------+---------
100 nomatch tblent | 200754.53 | 61.18 | 5.72 | 73.10
-------------------+-----------+---------+-----------+---------
1K nomatch tblent | 199750.35 | 61.54 | 5.73 | 72.90
-------------------+-----------+---------+-----------+---------
10K nomatch tblent | 198412.93 | 62.17 | 5.66 | 73.08

It scales pretty well with the number of no-match table entries.
En if it is compared w/ no-ipfw case, the performance and latency
impacts of the ipfw after this commit are pretty small.

show more ...


# c12f07ff 05-Sep-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

ipfw3: Simplify sockopt.


# 31ce7747 05-Sep-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

dummynet: Move ctrl function pointer to dummynet


# b0e7fb3e 05-Sep-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

ipfw: Simplify sockopt.


# 5204e13c 07-Aug-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

netisr: Simplify assertion related bits


Revision tags: v4.8.1
# aa35ea43 14-Apr-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

inpcb: Add function to set inpcbinfo's portinfo.

This unbreaks inpcbinfo.portinfo_mask -> inpcbinfo.portinfo_cnt
conversion for divert inpcbs (unused by rip inpcbs).


# d930a2f2 08-Apr-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

inpcb: Use netisr_ncpus for listing inpcbs.


Revision tags: v4.8.0, v4.6.2, v4.9.0, v4.8.0rc
# f4668135 16-Feb-2017 Sepherosa Ziehau <sephe@dragonflybsd.org>

Unbreak kernel building


Revision tags: v4.6.1, v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0, v4.4.3, v4.4.2
# 0723a285 07-Dec-2015 Sepherosa Ziehau <sephe@dragonflybsd.org>

inpcb: Split portinfo token into tokens for porthash head

And use pooled token for porthash head. This avoids another 10K/s
~20K/s contention during local port selection.


Revision tags: v4.4.1, v4.4.0, v4.5.0, v4.4.0rc, v4.2.4
# 471bee20 31-Jul-2015 Sepherosa Ziehau <sephe@dragonflybsd.org>

net: Factor out ASSERT_IN_NETISR and ASSERT_IS_NETISR


Revision tags: v4.3.1, v4.2.3, v4.2.1, v4.2.0, v4.0.6, v4.3.0, v4.2.0rc, v4.0.5
# 6a03354e 12-Mar-2015 Matthew Dillon <dillon@apollo.backplane.com>

ipfw2 - Rename FreeBSD ipfw port to ipfw3

* Rename all elements of the port to ipfw3 to reduce confusion.


Revision tags: v4.0.4
# 950193f2 07-Feb-2015 Bill Yuan <bycn82@gmail.com>

Version 'alpha 1' of ipfw2 firewall module for DragonflyBSD.
1. Modular design
2. Lockless stateful firewall
3. In-kernel NAT using libalias
4. Enhanced policy routing. (coming soon)


Revision tags: v4.0.3, v4.0.2
# 37cedf07 04-Dec-2014 Bill Yuan <bycn82@gmail.com>

Refactor the source for ipfw2.


# b5523eac 19-Feb-2015 Sascha Wildner <saw@online.de>

kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.

The main reason is that our having to use the MB_WAIT and MB_DONTWAIT
flags was a recurring issue when porting drivers from FreeBSD

kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.

The main reason is that our having to use the MB_WAIT and MB_DONTWAIT
flags was a recurring issue when porting drivers from FreeBSD because
it tended to get forgotten and the code would compile anyway with the
wrong constants. And since MB_WAIT and MB_DONTWAIT ended up as ocflags
for an objcache_get() or objcache_reclaimlist call (which use M_WAITOK
and M_NOWAIT), it was just one big converting back and forth with some
sanitization in between.

This commit allows M_* again for the mbuf functions and keeps the
sanitizing as it was before: when M_WAITOK is among the passed flags,
objcache functions will be called with M_WAITOK and when it is absent,
they will be called with M_NOWAIT. All other flags are scrubbed by the
MB_OCFLAG() macro which does the same as the former MBTOM().

Approved-by: dillon

show more ...


# b4051e25 22-Jan-2015 Sepherosa Ziehau <sephe@dragonflybsd.org>

ifnet: Make ifnet and ifindex2ifnet MPSAFE

- Accessing to these two global variables from non-netisr threads uses
ifnet lock. This kind of accessing is from
- Accessing to ifindex2ifnet from neti

ifnet: Make ifnet and ifindex2ifnet MPSAFE

- Accessing to these two global variables from non-netisr threads uses
ifnet lock. This kind of accessing is from
- Accessing to ifindex2ifnet from netisrs are lockless MPSAFE.
- Netisrs no longer access ifnet, instead they access ifnet array as of
this commit, which is lockless MPSAFE.

Rules for accessing ifnet and ifindex2ifnet is commented near the
declaration of the related global variables/functions in net/if_var.h.

show more ...


# 727ccde8 18-Dec-2014 Sepherosa Ziehau <sephe@dragonflybsd.org>

inet/inet6: Remove the v4-mapped address support

This greatly simplies the code (even the IPv4 code) and avoids all kinds
of possible port theft.

INPCB:
- Nuke IN6P_IPV6_V6ONLY, which is always on

inet/inet6: Remove the v4-mapped address support

This greatly simplies the code (even the IPv4 code) and avoids all kinds
of possible port theft.

INPCB:
- Nuke IN6P_IPV6_V6ONLY, which is always on after this commit.
- Change inp_vflag into inp_af (AF_INET or AF_INET6), since the socket
is either IPv6 or IPv4, but never both. Set inpcb.inp_af in
in_pcballoc() instead of in every pru_attach methods. Add INP_ISIPV4()
and INP_ISIPV6() macros to check inpcb family (socket family and
inpcb.inp_af are same).
- Nuke the convoluted code in in_pcbbind() and in6_pcbbind() which is used
to allow wildcard binding to accepting IPv4 connections on IPv6 wildcard
bound sockets.
- Nuke the code in in_pcblookup_pkthash() to match IPv4 faddr with IPv6
wildcard bound socket.
- Nuke in6_mapped_{peeraddr,sockaddr,savefaddr}(); use in6_{setpeeraddr,
setsockaddr,savefaddr}() directly.
- Nuke v4-mapped address convertion functions.
- Don't allow binding to v4-mapped address in in6_pcbind().
- Don't allow connecting to v4-mapped address in in6_pcbconnect().

TCP:
- Nuke the code in tcp_output() which takes care of the IP header TTL
setting for v4-mapped IPv6 socket.
- Don't allow binding to v4-mapped address (through in6_pcbbind()).
- Don't allow connecting to v4-mapped address and nuke the related code
(PRUC_NAMALLOC etc.).
- Nuke the code (PRUC_FALLBACK etc.) to fallback to IPv4 connection if
IPv6 connection fails, which is wrong.
- Nuke the code for v4-mapped IPv6 socket in tcp6_soport().

UDP:
- Nuke the code for v4-mapped IPv6 socket in udp_input() and udp_append().
- Don't allow binding to v4-mapped address (through in6_pcbbind()).
- Don't allow connecting to v4-mapped address.
- Don't allow sending datagrams to v4-mapped address and nuke the related
code in udp6_output().
- Nuke the code for v4-mapped IPv6 socket in udp6_disconnect()

RIP:
- Don't allow sending packets to v4-mapped address.
- Don't allow binding to v4-mapped address.
- Don't allow connecting to v4-mapped address.

Misc fixup:
- Don't force rip pru_attach method to return 0. If in_pcballoc() fails,
just return the error code.

show more ...


Revision tags: v4.0.1, v4.0.0, v4.0.0rc3, v4.0.0rc2, v4.0.0rc, v4.1.0
# 8ba7dcb1 25-Sep-2014 Sepherosa Ziehau <sephe@dragonflybsd.org>

socket: Provide socket owner cpuid hint

If the cpuid hint could not be provided or the cpuid hint does not make
sense, -1 will be returned as cpuid hint, e.g. TCP listen sockets w/o
SO_REUSEPORT.

T

socket: Provide socket owner cpuid hint

If the cpuid hint could not be provided or the cpuid hint does not make
sense, -1 will be returned as cpuid hint, e.g. TCP listen sockets w/o
SO_REUSEPORT.

This helps avoiding unnecessary IPIs and contention on receiving sockbuf
token.

show more ...


1234