History log of /netbsd-src/sys/netinet6/ip6_forward.c (Results 1 – 25 of 102)
Revision Date Author Comments
# c5711800 29-Jun-2024 riastradh <riastradh@NetBSD.org>

netinet6: Use _NET_STAT* API instead of direct array access.

XXX Exception: ip6flow_addstats_rt _assigns_ one of the `statistics'
to the current count of ip6 flows in use, and we don't have anything

netinet6: Use _NET_STAT* API instead of direct array access.

XXX Exception: ip6flow_addstats_rt _assigns_ one of the `statistics'
to the current count of ip6 flows in use, and we don't have anything
in the _NET_STAT* API for that. So for now I abuse the abstraction,
until we sort out this one exceptional case properly.

PR kern/58380

show more ...


# 9e214c7f 28-Aug-2020 ozaki-r <ozaki-r@NetBSD.org>

inet6: reduce silent packet discards


# 4c639cc7 28-Aug-2020 ozaki-r <ozaki-r@NetBSD.org>

inet6: pass rcvif to ip6_forward to avoid extra psref_acquire


# c1e00d7d 28-Aug-2020 ozaki-r <ozaki-r@NetBSD.org>

inet, inet6: count packets dropped by IPsec

The counters count packets dropped due to security policy checks.


# b05648aa 12-Jun-2020 roy <roy@NetBSD.org>

Remove in-kernel handling of Router Advertisements

This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note

Remove in-kernel handling of Router Advertisements

This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now
needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl.

Compat is fully provided where it makes sense, but trying to turn on
RA handling will obviously throw an error as it no longer exists.

Note that if you use IPv6 temporary addresses, this now needs to be
turned on in dhcpcd.conf(5) rather than in sysctl.conf(5).

show more ...


# c535599f 01-Nov-2019 knakahara <knakahara@NetBSD.org>

Fix ipsecif(4) IPV6_MINMTU does not work correctly.


# e524fb36 19-Sep-2019 ozaki-r <ozaki-r@NetBSD.org>

Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users. If the storages went short, percpu(9) enlarges them by

Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users. If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.
A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing. Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by knakahara@ and yamaguchi@

show more ...


# 6d8eb4f9 13-May-2019 ozaki-r <ozaki-r@NetBSD.org>

Count packets dropped by pfil


# 86ac125b 01-May-2018 maxv <maxv@NetBSD.org>

Remove now unused net_osdep.h includes, the other BSDs did the same.


# eee3723d 26-Apr-2018 maxv <maxv@NetBSD.org>

Stop using m_copy(), use m_copym() directly. m_copy is useless,
undocumented and confusing.


# e62bbe68 18-Apr-2018 maxv <maxv@NetBSD.org>

Remove unused netipsec/xform.h includes.


# 90dd9967 29-Jan-2018 maxv <maxv@NetBSD.org>

style


# a7c05638 29-Jan-2018 maxv <maxv@NetBSD.org>

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.


# 8c09e9f9 09-Jan-2018 ozaki-r <ozaki-r@NetBSD.org>

Fix use-after-free of mbuf by ip6flow_create (one more)

XXX need pullup-[678]


# a29d76a1 09-Jan-2018 ozaki-r <ozaki-r@NetBSD.org>

Fix use-after-free of mbuf by ip6flow_create

This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.

XXX need pullup-[678]


# 0c084e85 02-Aug-2017 ozaki-r <ozaki-r@NetBSD.org>

Make IPsec SPD MP-safe

We use localcount(9), not psref(9), to make the sptree and secpolicy (SP)
entries MP-safe because SPs need to be referenced over opencrypto
processing that executes a callback

Make IPsec SPD MP-safe

We use localcount(9), not psref(9), to make the sptree and secpolicy (SP)
entries MP-safe because SPs need to be referenced over opencrypto
processing that executes a callback in a different context.

SPs on sockets aren't managed by the sptree and can be destroyed in softint.
localcount_drain cannot be used in softint so we delay the destruction of
such SPs to a thread context. To do so, a list to manage such SPs is added
(key_socksplist) and key_timehandler_spd deletes dead SPs in the list.

For more details please read the locking notes in key.c.

Proposed on tech-kern@ and tech-net@

show more ...


# 808b116a 09-May-2017 ozaki-r <ozaki-r@NetBSD.org>

Add missing KEY_FREESP to ip6_forward


# 3f909d17 14-Feb-2017 ozaki-r <ozaki-r@NetBSD.org>

Do ND in L2_output in the same manner as arpresolve

The benefits of this change are:
- The flow is consistent with IPv4 (and FreeBSD and OpenBSD)
- old: ip6_output => nd6_output (do ND if needed)

Do ND in L2_output in the same manner as arpresolve

The benefits of this change are:
- The flow is consistent with IPv4 (and FreeBSD and OpenBSD)
- old: ip6_output => nd6_output (do ND if needed) => L2_output (lookup a stored cache)
- new: ip6_output => L2_output (lookup a cache. Do ND if cache not found)
- We can remove some workarounds in nd6_output
- We can move L2 specific operations to their own place
- The performance slightly improves because one cache lookup is reduced

show more ...


# 35561f6b 16-Jan-2017 christos <christos@NetBSD.org>

ip6_sprintf -> IN6_PRINT so that we pass the size.


# 28f4c24c 16-Jan-2017 ryo <ryo@NetBSD.org>

Make ip6_sprintf(), in_fmtaddr(), lla_snprintf() and icmp6_redirect_diag() mpsafe.

Reviewed by ozaki-r@


# 2b82ef9b 11-Jan-2017 ozaki-r <ozaki-r@NetBSD.org>

Get rid of unnecessary header inclusions


# 4c25fb2f 08-Dec-2016 ozaki-r <ozaki-r@NetBSD.org>

Add rtcache_unref to release points of rtentry stemming from rtcache

In the MP-safe world, a rtentry stemming from a rtcache can be freed at any
points. So we need to protect rtentries somehow say b

Add rtcache_unref to release points of rtentry stemming from rtcache

In the MP-safe world, a rtentry stemming from a rtcache can be freed at any
points. So we need to protect rtentries somehow say by reference couting or
passive references. Regardless of the method, we need to call some release
function of a rtentry after using it.

The change adds a new function rtcache_unref to release a rtentry. At this
point, this function does nothing because for now we don't add a reference
to a rtentry when we get one from a rtcache. We will add something useful
in a further commit.

This change is a part of changes for MP-safe routing table. It is separated
to avoid one big change that makes difficult to debug by bisecting.

show more ...


# 543e39c0 31-Aug-2016 ozaki-r <ozaki-r@NetBSD.org>

Make ipforward_rt and ip6_forward_rt percpu

Sharing one rtcache between CPUs is just a bad idea.

Reviewed by knakahara@


# ca4ea29d 28-Jun-2016 ozaki-r <ozaki-r@NetBSD.org>

Add missing NULL checks for m_get_rcvif_psref


# fe6d4275 10-Jun-2016 ozaki-r <ozaki-r@NetBSD.org>

Avoid storing a pointer of an interface in a mbuf

Having a pointer of an interface in a mbuf isn't safe if we remove big
kernel locks; an interface object (ifnet) can be destroyed anytime in any
pac

Avoid storing a pointer of an interface in a mbuf

Having a pointer of an interface in a mbuf isn't safe if we remove big
kernel locks; an interface object (ifnet) can be destroyed anytime in any
packet processing and accessing such object via a pointer is racy. Instead
we have to get an object from the interface collection (ifindex2ifnet) via
an interface index (if_index) that is stored to a mbuf instead of an
pointer.

The change provides two APIs: m_{get,put}_rcvif_psref that use psref(9)
for sleep-able critical sections and m_{get,put}_rcvif that use
pserialize(9) for other critical sections. The change also adds another
API called m_get_rcvif_NOMPSAFE, that is NOT MP-safe and for transition
moratorium, i.e., it is intended to be used for places where are not
planned to be MP-ified soon.

The change adds some overhead due to psref to performance sensitive paths,
however the overhead is not serious, 2% down at worst.

Proposed on tech-kern and tech-net.

show more ...


12345