History log of /freebsd/sys/compat/linux/linux.c (Results 1 – 25 of 44)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 9d4a08d1 29-Mar-2024 Gleb Smirnoff <glebius@FreeBSD.org>

linux: use sa_family_t for address family conversions

Express "conversion failed" with maximum possible value. This allows to
reduce number of size/signedness conversion in the code that utilizes t

linux: use sa_family_t for address family conversions

Express "conversion failed" with maximum possible value. This allows to
reduce number of size/signedness conversion in the code that utilizes the
functions.

PR: 274536
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D44375

show more ...


# 2f5a315b 03-Mar-2024 Gleb Smirnoff <glebius@FreeBSD.org>

linux: require vnet(9) context in ifname_bsd_to_linux_name()

This function is used by netlink(9) only. The netlink(9) taskqueue thread
runs in the vnet of the socket whose request the thread is pro

linux: require vnet(9) context in ifname_bsd_to_linux_name()

This function is used by netlink(9) only. The netlink(9) taskqueue thread
runs in the vnet of the socket whose request the thread is processing
right now. This is a correct vnet and resetting it to vnet0 is incorrect.
If the function is to be used by any other caller in addition to
netlink(9), it would be caller's responsiblity to provide correct vnet(9).

Reviewed by: melifaro, dchagin
Differential Revision: https://reviews.freebsd.org/D44191
PR: 277286

show more ...


Revision tags: release/13.3.0, release/14.0.0
# 3460fab5 18-Aug-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743


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

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

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


Revision tags: release/13.2.0
# 56928500 06-Mar-2023 Justin Hibbits <jhibbits@FreeBSD.org>

linux: Use the if_name() accessor to get loopback name

Avoid directly accessing the if_xname ifnet member. and use the
designated accessor function instead.

Sponsored by: Juniper Networks, Inc.


# 8243e174 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Fixup 5c32488de0 mis-merge


# 5c32488d 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Add a counterpart to linux_ifflags

For further use in linux_ioctl_socket add bsd_to_linux_ifflags() which
accepts FreeBSD interface flags and translate it to Linux if flags.

Reviewed by:

linux(4): Add a counterpart to linux_ifflags

For further use in linux_ioctl_socket add bsd_to_linux_ifflags() which
accepts FreeBSD interface flags and translate it to Linux if flags.

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

show more ...


# 945a7f0d 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Assert that the FreeBSD size of struct sockaddr is equal to Linux

Our code depends on the fact that the size of struct sockaddr and
the size of sa_data is equal between FreeBSD and Linux.


# 9883961e 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Drop excess assert that Linux IFNAMSIZ is equal to FreeBSD

While here use _Static_assert() instead of the older CTASSERT().


# 8d6dd96d 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Add net epoch assert to the linux_ifhwaddr, linux_ifflags

Now this functions are intended to use in the net epoch.

Reviewed by: emaste, melifaro
Differential Revision: https://reviews.fr

linux(4): Add net epoch assert to the linux_ifhwaddr, linux_ifflags

Now this functions are intended to use in the net epoch.

Reviewed by: emaste, melifaro
Differential Revision: https://reviews.freebsd.org/D38795

show more ...


# f9b0675b 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Refactor socket ioctl path to avoid referencing an unstable interfaces

Split the linux_ioctl_socket() function on two counterparts, where
the linux_ioctl_socket_ifreq() intended to use in

linux(4): Refactor socket ioctl path to avoid referencing an unstable interfaces

Split the linux_ioctl_socket() function on two counterparts, where
the linux_ioctl_socket_ifreq() intended to use in a code path which
requires the struct ifreq manipulation, i.e., translating in/out
values of the struct, while the linux_ioctl_socket() function is left
as is, it calls sys_ioctl() without touching in/out values.

Due to structures ifreq, sockaddr difference between FreeBSD and Linux
the linux_ioctl_socket_ifreq() calls kern_ioctl() directly, converting
in and out values to FreeBSD and to Linux accordingly.

Finally, modify the ifname_linux_to_bsd() to return error code, not
an unstable reference to the interface.

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

show more ...


# 5d5b633d 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linsysfs(4): Refactor to avoid referencing an unstable interfaces

Enter the net epoch when traversing a list of interfaces. For that
split the ifname_linux_to_bsd() function on two counterparts, whe

linsysfs(4): Refactor to avoid referencing an unstable interfaces

Enter the net epoch when traversing a list of interfaces. For that
split the ifname_linux_to_bsd() function on two counterparts, where
the ifname_linux_to_ifp() intended to use in epoch, while the
ifname_linux_to_bsd() intended to be a self-contained.
Until the linux_ioctl_coket() function is refactored, the
ifname_linux_to_bsd() temporarily returns interface outside
of the net epoch.

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

show more ...


# 130383f2 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Make linux_ifflags return a value

To simplify the use of the function in the printf-like statements.

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


# 6c5786fd 04-Mar-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Migrate to IfAPI

Migrate linux and linprocfs to use the IfAPI interfaces instead of
direct ifnet accesses.
The code initially writed by jhibbits@, and adapted by me to 3ab3c9c2.

Reviewed

linux(4): Migrate to IfAPI

Migrate linux and linprocfs to use the IfAPI interfaces instead of
direct ifnet accesses.
The code initially writed by jhibbits@, and adapted by me to 3ab3c9c2.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D38735

show more ...


# 3ab3c9c2 23-Feb-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Consolidate a FreeBSD interface names translation code

We have some amount of interface names translation functions which are
differs by bugs implementation. Consolidates it in a one place

linux(4): Consolidate a FreeBSD interface names translation code

We have some amount of interface names translation functions which are
differs by bugs implementation. Consolidates it in a one place.

Fixup loopback interface names translation and use ifnet methods and
accessors, where possible.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D38714
MFC after: 3 days
X-MFC with: 32fdc75fe7

show more ...


# e9e637bf 21-Feb-2023 Justin Hibbits <jhibbits@FreeBSD.org>

Revert "Port Linuxulator to IfAPI"

Revert pending netlink fixes, and further fixes to this.

This reverts commit 52d984831d82d97dc132d0d57fca6ee89572799b.

Requested by: dchagin


# 52d98483 01-Feb-2023 Justin Hibbits <jhibbits@FreeBSD.org>

Port Linuxulator to IfAPI

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


# d8e53d94 14-Feb-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Cleanup includes under compat/linux

Cleanup unneeded includes, sort the rest according to style(9).
No functional changes.

MFC after: 2 weeks


# 77f66834 14-Feb-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Fix brackets of local include opt_inet6

MFC after: 2 weeks


# 32fdc75f 14-Feb-2023 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Move use_real_names knob to the linux.c

MI linux.[c|h] are the module independent in terms of the Linux emulation
layer (ie, intended for both ISA - 32 & 64 bit), analogue of MD linux.h.
T

linux(4): Move use_real_names knob to the linux.c

MI linux.[c|h] are the module independent in terms of the Linux emulation
layer (ie, intended for both ISA - 32 & 64 bit), analogue of MD linux.h.
There must be a code here that cannot be placed into the corresponding by
common sense MI source and header files, i.e., code is machine independent,
but ISA dependent.
For the use_real_names knob, the code must be placed into the
linux_socket.[c|h], however linux_socket is ISA dependent.

MFC after: 2 weeks

show more ...


Revision tags: release/12.4.0
# 7c40e2d5 26-Aug-2022 Alexander V. Chernikov <melifaro@FreeBSD.org>

linuxolator: add netlink support

Add the glue code to support netlink in Linuxolator.
linux_common(4) now depends on netlink(4).

All netlink protocol constants are consistent with the Linux version

linuxolator: add netlink support

Add the glue code to support netlink in Linuxolator.
linux_common(4) now depends on netlink(4).

All netlink protocol constants are consistent with the Linux version.
However, certain OS-specific constants such as AF_INET6, interface
flags or default routing table id, are different between FreeBSD and
Linux. Thus, it may be needed to rewrite some message parts or even
rewrite the whole message, adding or removing some TLVs. The core
netlink implementation code provides efficient rewriting callbacks
which Linuxolator now uses.

Reviewed by: dchagin
Differential Revision: https://reviews.freebsd.org/D36361
MFC after: 2 months

show more ...


# 7a7cee55 30-May-2022 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Refactor SIGPWR mapping

Map Linux RT signals to the native RT signals starting from SIGRTMIN,
and Linux SIGPWR signal map to after the last RT signal.

MFC after: 2 weeks


# 63355839 28-May-2022 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): For future use replace malloc type for l_sockaddr by M_LINUX

MFC after: 2 weeks


Revision tags: release/13.1.0
# bbddd588 25-Apr-2022 Dmitry Chagin <dchagin@FreeBSD.org>

linux(4): Microoptimize bsd_to_linux_sockaddr().

Differential Revision: https://reviews.freebsd.org/D34725
MFC after: 2 weeks


# 513c7a6e 11-Feb-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: make fget_unlocked take a thread argument

Just like other fget routines. This enables embedding fd table pointer
in struct thread, avoiding taking a trip through proc.


12