History log of /src/sys/netinet/igmp.c (Results 1 – 25 of 749)
Revision Date Author Comments
# d19fd2f3 13-Feb-2026 Mark Johnston <markj@FreeBSD.org>

ip_mroute: Make the routing socket private

I have some patches which make ip_mroute and ip6_mroute multi-FIB-aware.
This enables running per-FIB routing daemons, each of which has a
separate routing

ip_mroute: Make the routing socket private

I have some patches which make ip_mroute and ip6_mroute multi-FIB-aware.
This enables running per-FIB routing daemons, each of which has a
separate routing socket.

Several places in the network stack check whether multicast routing is
configured by checking whether the multicast routing socket is non-NULL.
This doesn't directly translate in my proposed scheme, as each FIB would
have its own socket. I'd like to modify the ip(6)_mroute code to store
all state, including the socket, in a per-FIB structure. So, take a
step towards that and 1) hide the socket, 2) add a boolean flag which
indicates whether a multicast router is registered.

Reviewed by: pouria, zlei, glebius, adrian
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55236

show more ...


# 9df6a7f9 09-Feb-2026 Mark Johnston <markj@FreeBSD.org>

ip_mroute: Try to make function pointer declarations more consistent

The ip_mroute and ip6_mroute modules hook into the network stack via
several function pointers. Declarations for these pointers

ip_mroute: Try to make function pointer declarations more consistent

The ip_mroute and ip6_mroute modules hook into the network stack via
several function pointers. Declarations for these pointers are
scattered around several headers. Put them all in the same place,
ip(6)_mroute.h.

No functional change intended.

Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55058

show more ...


# 0d469d23 18-Dec-2025 Gleb Smirnoff <glebius@FreeBSD.org>

net: attach IPv4 and IPv6 stacks to an interface with EVENTHANDLER(9)

This change retires two historic relics: the if_afdata[] array and the
dom_ifattach/dom_ifdetach methods.

The if_afdata[] array

net: attach IPv4 and IPv6 stacks to an interface with EVENTHANDLER(9)

This change retires two historic relics: the if_afdata[] array and the
dom_ifattach/dom_ifdetach methods.

The if_afdata[] array is a relic of the era, when there was expectation
that many transport protocols will coexist with IP, e.g. IPX or NetAtalk.
The array hasn't had any members except AF_INET and AF_INET6 for over a
decade already. This change removes the array and just leaves two pointer
fields: if_inet and if_inet6.

The dom_ifattach/dom_ifdetach predates the EVENTHANDLER(9) framework and
was a good enough method to initialize protocol contexts back then. Today
there is no good reason to treat IPv4 and IPv6 stacks differently to other
protocols/features that attach and detach from an interface.

The locking of if_afdata[] is a relic of SMPng times, when the system
startup and the interface attach was even more convoluted than before this
change, and we also had unloadable protocols that used a field in
if_afdata[]. Note that IPv4 and IPv6 are not unloadable.

Note that this change removes NET_EPOCH_WAIT() from the interface detach
sequence. This may surface several new races associated with interface
removal. I failed to hit any with consecutive test suite runs, though.
The expected general race scenario is that while struct ifnet is freed
with proper epoch_call(9) itself, some structures hanging off ifnet are
freed with direct free(9). The proper fix is either make if_foo point at
some static "dead" structure providing SMP visibility of this store, or
free those structure with epoch_call(9). All of these cases are planned
to be found and resolved during 16.0-CURRENT lifetime.

Reviewed by: zlei, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D54089

show more ...


# 7b71f57f 03-Dec-2025 Warner Losh <imp@FreeBSD.org>

netinet: Remove left-over sys/cdefs.h

These were for $FreeBSD$ that was removed a while ago, but these
includes didn't get swept up in that. Remove them all now.

Sponsored by: Netflix
MFC After:

netinet: Remove left-over sys/cdefs.h

These were for $FreeBSD$ that was removed a while ago, but these
includes didn't get swept up in that. Remove them all now.

Sponsored by: Netflix
MFC After: 2 weeks

show more ...


# d2c2d6d6 14-Mar-2025 Olivier BLANC <etihwo@outlook.com>

igmp: apply net.inet.igmp.default_version to existing interfaces

IGMP requires hosts to use the lowest version they have seen on the network.
When net.inet.igmp.default_version is changed, we do not

igmp: apply net.inet.igmp.default_version to existing interfaces

IGMP requires hosts to use the lowest version they have seen on the network.
When net.inet.igmp.default_version is changed, we do not change IGMP
version used by interface even if the interface use an higher version than
V_igmp_default_version. So we could send IGMPv3 even if the user has requested
IGMPv2 or IGMPv1 via the sysctl.

Change IGMP version for each interface when V_igmp_default_version is smaller
than the version used by the interface.

Pull Request: https://github.com/freebsd/freebsd-src/pull/1615
Differential Revision: https://reviews.freebsd.org/D50071

show more ...


# 28aafeb8 31-Oct-2024 John Baldwin <jhb@FreeBSD.org>

netinet*: Add assertions for some places that don't support M_EXTPG mbufs

Found while auditing calls to M_WRITABLE to see if M_EXTPG could be
removed from its checks.

Reviewed by: gallatin
Differen

netinet*: Add assertions for some places that don't support M_EXTPG mbufs

Found while auditing calls to M_WRITABLE to see if M_EXTPG could be
removed from its checks.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D46785

show more ...


# bbf86c65 12-Mar-2023 Mark Johnston <markj@FreeBSD.org>

netinet: Remove stale references to Giant from comments

MFC after: 1 week


# 8cb9b68f 09-Jan-2024 John Baldwin <jhb@FreeBSD.org>

sys: Use mbufq_empty instead of comparing mbufq_len against 0

Reviewed by: bz, emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43338


# 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 ...


# b94ec00b 29-Aug-2023 Kristof Provost <kp@FreeBSD.org>

igmp: do not upgrade IGMP version beyond net.inet.igmp.default_version

IGMP requires hosts to use the lowest version they've seen on the
network. When the IGMP timers expire we take the opportunity

igmp: do not upgrade IGMP version beyond net.inet.igmp.default_version

IGMP requires hosts to use the lowest version they've seen on the
network. When the IGMP timers expire we take the opportunity to upgrade again.
However, we did not take the net.inet.igmp.default_version sysctl
setting into account, so we could end up switching to IGMPv3 even if the
user had requested IGMPv2 or IGMPv1 via the sysctl.

Check V_igmp_default_version before we upgrade the IGMP version.

Reviewed by: adrian
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41628

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 3d0d5b21 23-Jan-2023 Justin Hibbits <jhibbits@FreeBSD.org>

IfAPI: Explicitly include <net/if_private.h> in netstack

Summary:
In preparation of making if_t completely opaque outside of the netstack,
explicitly include the header. <net/if_var.h> will stop in

IfAPI: Explicitly include <net/if_private.h> in netstack

Summary:
In preparation of making if_t completely opaque outside of the netstack,
explicitly include the header. <net/if_var.h> will stop including the
header in the future.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38200

show more ...


# 1e9482f4 08-Oct-2022 Alexander Motin <mav@FreeBSD.org>

inet: Simplify if_multiaddrs iteration.

Similar to 2cd6ad766eb23 for inet6 drop ifma_restart use, creating more
problems than solving. It is no longer needed after epoch introduction.

While there,

inet: Simplify if_multiaddrs iteration.

Similar to 2cd6ad766eb23 for inet6 drop ifma_restart use, creating more
problems than solving. It is no longer needed after epoch introduction.

While there, add NULL check for ifma_ifp in igmp_change_state(), that
sometimes caused panics on interface destruction.

MFC after: 2 weeks

show more ...


# 0ce4d7ec 17-Aug-2022 Gleb Smirnoff <glebius@FreeBSD.org>

igmp: use callout(9) directly instead of pr_slowtimo, pr_fasttimo

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36160


# 808b7d80 13-May-2022 Gleb Smirnoff <glebius@FreeBSD.org>

mbuf: remove PH_vt alias for mbuf packet header persistent shared data

Mechanical sed change s/PH_vt\.vt_nrecs/vt_nrecs/g


# 8b6ccfb6 06-Apr-2022 John Baldwin <jhb@FreeBSD.org>

multicast code: Quiet unused warnings for variables used for KTR traces.

For nallow and nblock, move the variables under #ifdef KTR.

For return values from functions logged in KTR traces, mark the

multicast code: Quiet unused warnings for variables used for KTR traces.

For nallow and nblock, move the variables under #ifdef KTR.

For return values from functions logged in KTR traces, mark the
variables as __unused rather than having to #ifdef the assignment of
the function return value.

show more ...


# d74b7bae 04-Dec-2021 Gleb Smirnoff <glebius@FreeBSD.org>

ifnet_byindex() actually requires network epoch

Sweep over potentially unsafe calls to ifnet_byindex() and wrap them
in epoch. Most of the code touched remains unsafe, as the returned
pointer is be

ifnet_byindex() actually requires network epoch

Sweep over potentially unsafe calls to ifnet_byindex() and wrap them
in epoch. Most of the code touched remains unsafe, as the returned
pointer is being used after epoch exit. Mark that with a comment.

Validate the index argument inside the function, reducing argument
validation requirement from the callers and making V_if_index
private to if.c.

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D33263

show more ...


# 2144431c 08-Oct-2021 Gleb Smirnoff <glebius@FreeBSD.org>

Remove in_ifaddr_lock acquisiton to access in_ifaddrhead.

An IPv4 address is embedded into an ifaddr which is freed
via epoch. And the in_ifaddrhead is already a CK list. Use
the network epoch to pr

Remove in_ifaddr_lock acquisiton to access in_ifaddrhead.

An IPv4 address is embedded into an ifaddr which is freed
via epoch. And the in_ifaddrhead is already a CK list. Use
the network epoch to protect against use after free.

Next step would be to CK-ify the in_addr hash and get rid of the...

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D32434

show more ...


# 6c34dde8 05-May-2021 Mark Johnston <markj@FreeBSD.org>

igmp: Avoid an out-of-bounds access when zeroing counters

When verifying, byte-by-byte, that the user-supplied counters are
zero-filled, sysctl_igmp_stat() would check for zero before checking the
l

igmp: Avoid an out-of-bounds access when zeroing counters

When verifying, byte-by-byte, that the user-supplied counters are
zero-filled, sysctl_igmp_stat() would check for zero before checking the
loop bound. Perform the checks in the correct order.

Reported by: KASAN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

show more ...


# 50115969 08-Jan-2021 Mark Johnston <markj@FreeBSD.org>

igmp: Avoid leaking mbuf when source validation fails

PR: 252504
Submitted by: Panagiotis Tsolakos <panagiotis.tsolakos@gmail.com>
MFC after: 3 days


# b02c4e5c 08-Nov-2020 Mitchell Horne <mhorne@FreeBSD.org>

igmp: convert igmpstat to use PCPU counters

Currently there is no locking done to protect this structure. It is
likely okay due to the low-volume nature of IGMP, but allows for
the possibility of un

igmp: convert igmpstat to use PCPU counters

Currently there is no locking done to protect this structure. It is
likely okay due to the low-volume nature of IGMP, but allows for
the possibility of underflow. This appears to be one of the only
holdouts of the conversion to counter(9) which was done for most
protocol stat structures around 2013.

This also updates the visibility of this stats structure so that it can
be consumed from elsewhere in the kernel, consistent with the vast
majority of VNET_PCPUSTAT structures.

Reviewed by: kp
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27023

show more ...


# 662c1305 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

net: clean up empty lines in .c and .h files


# 2ac6b71f 07-Mar-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r358712 through r358730.


# d726e633 07-Mar-2020 Hiroki Sato <hrs@FreeBSD.org>

Fix an issue of net.inet.igmp.stats handler.
The header of (struct igmpstat) could be cleared by sysctl(3).
This can be reproduced by "netstat -s -z -p igmp".

PR: 244584
MFC after: 1 week


# 3c4ad300 17-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r358000 through r358048.


12345678910>>...30