History log of /freebsd/sys/net/if.c (Results 1 – 25 of 1297)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 8e1af802 09-Dec-2024 Gleb Smirnoff <glebius@FreeBSD.org>

IfAPI: make if_getlladdr() to return char *

No functional change. The caddr_t is a relic typedef from C version
that didn't have void pointer. In this particular change we really
need a char * poi

IfAPI: make if_getlladdr() to return char *

No functional change. The caddr_t is a relic typedef from C version
that didn't have void pointer. In this particular change we really
need a char * pointer rather than void, because some consumers use
the link level address as a char array.

show more ...


# d3f035f8 09-Dec-2024 Gleb Smirnoff <glebius@FreeBSD.org>

ifnet: make sa_dl_equal() a static function

No functional change. Also clears last use of CLLADDR() macro.


Revision tags: release/14.2.0
# d1d839d0 22-Oct-2024 Zhenlei Huang <zlei@FreeBSD.org>

ifnet: Assert that we are assigning network stack correctly

It makes no sense to assign NULL vnet to an interface when the kernel
option VIMAGE is enabled. Add an assertion to catch that.

This will

ifnet: Assert that we are assigning network stack correctly

It makes no sense to assign NULL vnet to an interface when the kernel
option VIMAGE is enabled. Add an assertion to catch that.

This will also help diagnosing problem report [1] and [2].

1. https://bugs.freebsd.org/275381
2. https://bugs.freebsd.org/282168

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D46982

show more ...


Revision tags: release/13.4.0
# 58f19422 06-Sep-2024 Mark Johnston <markj@FreeBSD.org>

ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl()

IFF_ALLMULTI has an associated activation counter and so needs special
treatment, like IFF_PROMISC. Introduce IFF_PALLMULTI, akin to
IFF

ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl()

IFF_ALLMULTI has an associated activation counter and so needs special
treatment, like IFF_PROMISC. Introduce IFF_PALLMULTI, akin to
IFF_PPROMISC, which indicates that userspace requested allmulti mode,
and handle it specially in ifhwioctl().

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

show more ...


# 408c909d 04-Sep-2024 Mark Johnston <markj@FreeBSD.org>

ifnet: Remove if_getamcount()

All uses of this function were incorrect. if_amcount is a reference
count which tracks the number of times the network stack internally set
IFF_ALLMULTI. (if_pcount i

ifnet: Remove if_getamcount()

All uses of this function were incorrect. if_amcount is a reference
count which tracks the number of times the network stack internally set
IFF_ALLMULTI. (if_pcount is the corresponding counter for IFF_PROMISC.)

Remove if_getamcount() and fix up callers to get the number of assigned
multicast addresses instead, since that's what they actually want.

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

show more ...


# bc06c514 27-Jun-2024 Konrad Witaszczyk <def@FreeBSD.org>

netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq

The SIOCDIFADDR{,_IN6} ioctls take an ifreq structure object, not an
ifaliasreq/in_aliasreq/in6_aliasreq structure object, as their argu

netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq

The SIOCDIFADDR{,_IN6} ioctls take an ifreq structure object, not an
ifaliasreq/in_aliasreq/in6_aliasreq structure object, as their argument.
As opposed to ifaliasreq/in_aliasreq/in6_aliasreq used by
SIOCAIFADDR{,_IN6}, the ifreq/in6_ifreq structures used by the
SIOCDIFADDR{,_IN6} ioctls do not include a separate field for a
broadcast address and other values required to add an address to a
network interface with SIOCAIFADDR{,_IN6}.

Whilst this issue is not specific to CHERI-extended architectures, it
was first observed on CheriBSD running on Arm Morello. For example,
incorrect calls using the in6_aliasreq object result in CHERI capability
violations. A pointer to the ifra_addr field in in6_aliasreq cast to the
ifru_addr union member of in6_ifreq results in bounds being set to the
union's larger size. Such bounds exceed the bounds of of in6_aliasreq
object and the bounds-setting instruction clears a tag of the object's
capability.

Reviewed by: brooks, kp, oshogbo
Accepted by: oshogbo (mentor)
Reported by: CHERI
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D46016

show more ...


Revision tags: release/14.1.0, release/13.3.0
# 2131654b 07-Feb-2024 Konstantin Belousov <kib@FreeBSD.org>

sys/net: Add IPSEC_OFFLOAD interface cap and methods structure

Reviewed by: glebius
Sponsored by: NVIDIA networking
Differential revision: https://reviews.freebsd.org/D44314


# 9738277b 30-Jun-2024 Zhenlei Huang <zlei@FreeBSD.org>

ifnet: Remove dead code

Since change [1], if_bpf will not be detached by the interface departure
eventhandler and will not be NULL. Then the logic to re-attach if_bpf
becomes dead and serves no purp

ifnet: Remove dead code

Since change [1], if_bpf will not be detached by the interface departure
eventhandler and will not be NULL. Then the logic to re-attach if_bpf
becomes dead and serves no purpose any more.

This partially reverts commit 05fc416403ec.

1. 9ce40d321dd5 bpf: Fix incorrect cleanup

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45599

show more ...


# ef4f4a44 27-Jun-2024 Zhenlei Huang <zlei@FreeBSD.org>

ifnet: Restore curvnet earlier

This improves readability a little. As a side effect, a redundant
CURVNET_RESTORE is removed.

No functional change intended.

Reviewed by: glebius
MFC after: 1 week
D

ifnet: Restore curvnet earlier

This improves readability a little. As a side effect, a redundant
CURVNET_RESTORE is removed.

No functional change intended.

Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45595

show more ...


# 71f8fbf9 24-Jun-2024 Zhenlei Huang <zlei@FreeBSD.org>

ifnet: Use NET_EPOCH_WAIT() macro

This makes it easier to grep the usage.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45715


# 43387b4e 06-May-2024 Kristof Provost <kp@FreeBSD.org>

if: guard against if_ioctl being NULL

There are situations where an struct ifnet has a NULL if_ioctl pointer.

For example, e6000sw creates such struct ifnets for each of its ports so it can
call in

if: guard against if_ioctl being NULL

There are situations where an struct ifnet has a NULL if_ioctl pointer.

For example, e6000sw creates such struct ifnets for each of its ports so it can
call into the MII code.

If there is then a link state event this calls do_link_state_change()
-> rtnl_handle_ifevent() -> dump_iface() -> get_operstate() ->
get_operstate_ether(). That wants to know if the link is up or down, so it tries
to ioctl(SIOCGIFMEDIA), which doesn't go well if if_ioctl is NULL.

Guard against this, and return EOPNOTSUPP.

PR: 275920
MFC ater: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

show more ...


# 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
# 9a071e4e 08-Sep-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

Assert that ifnet_detach_sxlock is held where needed.

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


# 2a371643 21-Jul-2023 Justin Hibbits <jhibbits@FreeBSD.org>

IfAPI: Retire if_etherbpfmtap() and if_bpfmtap()

Summary:
These came in the original DrvAPI commits in 2014, and are obsoleted by
bpf_mtap_if() and ether_bpf_mtap_if(). The `_if` suffix, rather tha

IfAPI: Retire if_etherbpfmtap() and if_bpfmtap()

Summary:
These came in the original DrvAPI commits in 2014, and are obsoleted by
bpf_mtap_if() and ether_bpf_mtap_if(). The `_if` suffix, rather than
prefix, conveys that it's operating on the bpf of the interface, instead
than the interface itself.

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

show more ...


# 2ff63af9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

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

Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/


# 79379355 16-Jun-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: convert to IfAPI.

Convert to IfAPI everything except `IF_AFDATA_WLOCK` usage in neigh.c.

Reviewed By: jhibbits
Differential Revision: https://reviews.freebsd.org/D40577


# c344eff9 16-Jun-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: dump interface capabilities with other interface data.

This change exports interface capabilities using the standard
Netlink attribute type, bitset, and switches `ifconfig(8)` to use
it whe

netlink: dump interface capabilities with other interface data.

This change exports interface capabilities using the standard
Netlink attribute type, bitset, and switches `ifconfig(8)` to use
it when displaying interface data.
Bitset comes in two representations. The first one is "compact",
where the bits are exported via two arrays - "mask" listing the
"valid" bits and "values, providing the values for those bits.
The second one is more verbose, listing each bit as a separate item,
with its name, id and value. The latter option is handy when submitting
update requests.

The support for setting capabilities will be added in the upcoming diffs.

Differential Revision: https://reviews.freebsd.org/D40331

show more ...


# a77facd2 01-Jun-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

ifnet: consistently call hooks when the interface gets up.

Some context on the current IPv6 interface setup & address management:

There are two data path for IPv6 initialisation in context of assig

ifnet: consistently call hooks when the interface gets up.

Some context on the current IPv6 interface setup & address management:

There are two data path for IPv6 initialisation in context of assigning
LL addresses:
1) Userland explicitly requests IFF_UP for the interface w/o any addresses.
if_up() then calls in6_if_up(), which calls in6_ifattach().
The latter sets up some initial ND/IN6 state and disables IPv6 for the
interface if it’s not loopback. If the interface is loopback, then it
adds ::1/128 and LL addresses via in6_ifattach_loopback().
Then, devd notification is generated (if the VNET is the default one),
which triggers rc.network ifconfig_up(), causing ifdisabled to be removed
via SIOCSIFINFO_IN6 from ifconfig. The kernel SIOCSIFINFO_IN6 handler
calls in6_if_up() once again and it assigns the interface link-local address.

2) Userland adds IPv4 or IPv6 address to the interface. SIOCAIFADDR[_IN6]
kernel handler calls IPv4/IPv6 protocol handler to add the address.
Both then call if_ioctl() with SIOCSIFADDR. Ethernet/loopback ioctl handlers
silently sets IFF_UP for the interface. Finally, if.c:ifioctl() wrapper code
compares old and new interface flags and, if IFF_UP is added, it explicitly
calls in6_if_up(), which adds link-local address if either the original
address is IPv6 or the interface is loopback.

In the latter case, “formal” interface-up notifications are missing.
The kernel does not trigger event handler event, does not call carp hook
and does not provide any userland notification.

This diff unifies the event handling in both scenarios, providing the
necessary notifications to the kernel and userland.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40332
MFC after: 2 weeks

show more ...


# f766d1d5 10-Apr-2023 Justin Hibbits <jhibbits@FreeBSD.org>

IfAPI: Add if_maddr_empty() to check for any maddrs

if_llmaddr_count() only counts link-level multicast addresses.
hv_netvsc(4) needs to know if there are any multicast addresses. Since
hv_netvsc(4

IfAPI: Add if_maddr_empty() to check for any maddrs

if_llmaddr_count() only counts link-level multicast addresses.
hv_netvsc(4) needs to know if there are any multicast addresses. Since
hv_netvsc(4) is the only instance where this would be used, make it a
simple boolean. If others need a if_maddr_count(), that can be added in
the future.

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

show more ...


# 56d4550c 19-Apr-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

ifnet: factor out interface renaming into a separate function.

This change is required to support interface renaming via Netlink.
No functional changes intended.

Reviewed by: zlei
Differential Revi

ifnet: factor out interface renaming into a separate function.

This change is required to support interface renaming via Netlink.
No functional changes intended.

Reviewed by: zlei
Differential Revision: https://reviews.freebsd.org/D39692
MFC after: 2 weeks

show more ...


Revision tags: release/13.2.0
# 7170774e 31-Mar-2023 Konstantin Belousov <kib@FreeBSD.org>

ifcapnv: cap_bit in ifcap2_nv_bit_names[] is bit, not index

Sponsored by: Nvidia networking


# badcb3fd 29-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

routing: fix panic when adding an interface route to the p2p interface
without and inet/inet6 addresses attached.

MFC after: 3 days


# e2427c69 16-Mar-2023 Justin Hibbits <jhibbits@FreeBSD.org>

IfAPI: Add iterator to complement if_foreach()

Summary:
Sometimes an if_foreach() callback can be trivial, or need a lot of
outer context. In this case a regular `for` loop makes more sense. To
ke

IfAPI: Add iterator to complement if_foreach()

Summary:
Sometimes an if_foreach() callback can be trivial, or need a lot of
outer context. In this case a regular `for` loop makes more sense. To
keep things hidden in the new API, use an opaque `if_iter` structure
that can still be instantiated on the stack. The current implementation
uses just a single pointer out of the 4 alotted to the opaque context,
and the cleanup does nothing, but may be used in the future.

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

show more ...


# df2b419a 04-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

ifnet: add if_foreach_sleep() to allow ifnet iterations with sleep.

Subscribers: imp, ae, glebius

Differential Revision: https://reviews.freebsd.org/D38904


# 66bdbcd5 03-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

net: unify mtu update code

Subscribers: imp, ae, glebius

Differential Revision: https://reviews.freebsd.org/D38893


12345678910>>...52