History log of /haiku/src/add-ons/kernel/network/stack/datalink.cpp (Results 1 – 25 of 76)
Revision Date Author Comments
# 5c9dc91f 13-Nov-2024 Augustin Cavalier <waddlesplash@gmail.com>

network: Aggregate statistics from the device, if any are provided.

This way, we report the real receive/send statistics, not just
the ones the stack knows.

Adjust the FreeBSD compatibility layer t

network: Aggregate statistics from the device, if any are provided.

This way, we report the real receive/send statistics, not just
the ones the stack knows.

Adjust the FreeBSD compatibility layer to report its stats directly
so they are accounted for this way.

show more ...


# 6a290d1d 13-Nov-2024 Augustin Cavalier <waddlesplash@gmail.com>

network/stack: Don't special-case ENOBUFS and EMSGSIZE in update_send_stats.

These errors are always reported, so we want to count them as
an "error" on send, not a "drop".


# 98166ebe 15-Feb-2024 Augustin Cavalier <waddlesplash@gmail.com>

network: Do not apply ethernet headers for loopback devices.

This reverts large portions of e2b57695fc3ec43cad099ab3dd93bdd99e052761
and all of 4e9653027d9094f4d57fd294d46ce6eb461b697f, and adjusts

network: Do not apply ethernet headers for loopback devices.

This reverts large portions of e2b57695fc3ec43cad099ab3dd93bdd99e052761
and all of 4e9653027d9094f4d57fd294d46ce6eb461b697f, and adjusts
the "tunnel" and "loopback_frame" handlers appropriately.

Initially, this logic was added so that libpcap continued working;
however, it seems that we can change some of the Haiku-specific code
in libpcap and have it continue to operate without requiring such
ethernet headers to be appended.

Fixes #18801.

Change-Id: Ie06908affde894ad1516fbc27e06298309a4e082
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7403
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 819c5108 29-Dec-2023 Augustin Cavalier <waddlesplash@gmail.com>

network: Update device statistics (mostly) in the stack.

We bypass device logic in datalink_send_routed_data() in the case
of RTF_LOCAL, so if we don't update the stats there, they'll never
get upda

network: Update device statistics (mostly) in the stack.

We bypass device logic in datalink_send_routed_data() in the case
of RTF_LOCAL, so if we don't update the stats there, they'll never
get updated. Furthermore, there's places packets can be dropped
inside the device reader thread. So, we might as well consolidate
the stats-updating logic and get it out of drivers.

(The only remaining case where drivers need to update stats is when
they drop a packet in receive(), as the stack can't tell when an error
from receive() is due to a dropped packet or not.)

Fixes a potential leak on packet drops in the device reader thread,
and fixes loopback statistics for TCP/UDP/etc.

show more ...


# 4e965302 18-May-2023 Jérôme Duval <jerome.duval@gmail.com>

net_stack: for local delivery, also capture packets when enabled

the packet capture expects frames: prepend an ethernet header for the capture.

Change-Id: I3d09da2a5a6924a545cc4fbc9dd1577bd3248226

net_stack: for local delivery, also capture packets when enabled

the packet capture expects frames: prepend an ethernet header for the capture.

Change-Id: I3d09da2a5a6924a545cc4fbc9dd1577bd3248226
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6452
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# e2b57695 18-May-2023 Jérôme Duval <jerome.duval@gmail.com>

loopback_frame: apply an ethernet header for packet capture

* the packet capture expects frames, so loopback_frame should actually apply framing and deframing
for loopback packets.
* datalink: set t

loopback_frame: apply an ethernet header for packet capture

* the packet capture expects frames, so loopback_frame should actually apply framing and deframing
for loopback packets.
* datalink: set the address for host routes
* device_interfaces: call the deframing if any in device_enqueue_buffer()
tested with ping 127.0.0.1 and ping6 ::1, while removing the local flag on both routes.

Change-Id: I2085735bdac3bb85908189a2e1acb2540818c7bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6451
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 97f11716 04-Sep-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Merge remote-tracking branch 'origin/master' into dev/netservices

Change-Id: I588c4a840523995f820161d63741c137bc5c719c


# 44fa45df 14-Jun-2022 Augustin Cavalier <waddlesplash@gmail.com>

net/if: Drop ifmediareq and just use the regular ifreq for SIOCGIFMEDIA.

This was introduced into the main API in 2010 (d72ede75fb252c24c8a5fcc39395f9ae1c202322),
but was actually only fully used fo

net/if: Drop ifmediareq and just use the regular ifreq for SIOCGIFMEDIA.

This was introduced into the main API in 2010 (d72ede75fb252c24c8a5fcc39395f9ae1c202322),
but was actually only fully used for the past month (c2a9a890f3ac7795602d11c0edaa20ac2db48202)
when SIOCGIFMEDIA was supported for all *BSD drivers and not just WiFi.
Most userland consumers of this structure did not use it correctly,
as was the case in #17770, and only worked because in the fallback case
the network stack just treated it as if it were an ifreq.

Nothing actually used the ifm_count/ifm_ulist (though tentative APIs
were exposed for it) as noted by previous commits; and the fact that
Haiku's IFM_* declarations are so spartan makes most of the returned
values unintelligible to userland without using FreeBSD compat headers.

If, in the future, we decide to implement ifmedia listing and selection
properly, that should likely be done with separate ioctls instead of
having multi-function ones like this.

This is technically an ABI break, but in practice it should not matter:
ifmediareq::ifm_current aligns with ifreq::ifr_media, so the things
that used this structure like our in-tree code did will continue to work.
Until this past May, the only other field that was usually set was
ifm_active, but in the absence of setting ifm_status all non-Haiku
consumers should ignore it completely.

The only consumer of this ioctl that I know of out of the tree,
wpa_supplicant, still works after these changes.

show more ...


# 83ac9b72 14-Jun-2022 Augustin Cavalier <waddlesplash@gmail.com>

network/stack: Do not invoke SIOCGIFMEDIA but just return the already-fetched media.

This functionally disables most of the functionality of the BSD-style
SIOCGIFMEDIA, but it was never used in user

network/stack: Do not invoke SIOCGIFMEDIA but just return the already-fetched media.

This functionally disables most of the functionality of the BSD-style
SIOCGIFMEDIA, but it was never used in userland (because if it had,
it would have triggered SMAP violations in the compatibility layer.)

SIOCGIFMEDIA returns BSD-style media values, which mostly overlap
with Haiku ones but have a few differences still. These are taken care
of in the compat layer by ETHER_GET_LINK_STATE, which is where this
media value comes from, but are not by SIOCGIFMEDIA which just passes
back whatever the drivers do.

Fixes #17770, at least for ethernet drivers.

show more ...


# 41faeb1d 27-May-2022 Augustin Cavalier <waddlesplash@gmail.com>

net_interface & datalink: Fix MTU handling.

The device is what actually controls the MTU, and it has its own
field for this, so having a second one just meant the MTU never
got updated after startup

net_interface & datalink: Fix MTU handling.

The device is what actually controls the MTU, and it has its own
field for this, so having a second one just meant the MTU never
got updated after startup.

Remove the "mtu" field from the interface, use the "device->mtu" directly,
and then actually invoke device->module->set_mtu when updating.

show more ...


# 071d7d3e 29-Oct-2020 Jérôme Duval <jerome.duval@gmail.com>

network/stack: assume zero length ioctl requests are valid

posix ioctl calls don't provide a request length. Theorically these length checks
could be removed altogether.

Change-Id: Ie53f10dc8d050dd

network/stack: assume zero length ioctl requests are valid

posix ioctl calls don't provide a request length. Theorically these length checks
could be removed altogether.

Change-Id: Ie53f10dc8d050dd3bdf2e5a792ed79f139a24d29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3364
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>

show more ...


# b18832d4 11-Feb-2011 Axel Dörfler <axeld@pinc-software.de>

* Only return the first address of the family if there was no address specified
in the request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40445 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b756a582 07-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Getting the device media now actually works as intended.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39757 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d72ede75 10-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* We now use a FreeBSD compatible ifmediareq structure for SIOCIFMEDIA, and
SIOCSIFMEDIA.
* Made sure that the two media ioctls are actually forwarded to the driver.
* Added NetworkDevice.cpp to th

* We now use a FreeBSD compatible ifmediareq structure for SIOCIFMEDIA, and
SIOCSIFMEDIA.
* Made sure that the two media ioctls are actually forwarded to the driver.
* Added NetworkDevice.cpp to the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39389 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 89bf19cc 27-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Made an uint32 out of net_socket::bound_to_device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38395 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 75b83073 17-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Getting an address leaked a reference. This fixes that interfaces could not
really be deleted (a reference of them was kept in memory).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38179

* Getting an address leaked a reference. This fixes that interfaces could not
really be deleted (a reference of them was kept in memory).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38179 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 44a3d0d1 15-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Spotted a few reference counting bugs that were probably responsible for
#6446, although I could not reproduce the exact problem.
* net_datalink::is_local_[link_]address() now releases a previous

* Spotted a few reference counting bugs that were probably responsible for
#6446, although I could not reproduce the exact problem.
* net_datalink::is_local_[link_]address() now releases a previous reference if
the _interfaceAddress arguments does not point to NULL.
* When a buffer is received from a device, it's interface_address should be NULL
already.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38118 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 2c12b8a3 12-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Also report the address index back to the userland.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38059 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 14d0b44b 12-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Applied the B_SOCKET_SET_ALIAS address retrieval logic to B_SOCKET_GET_ALIAS
as well (of course, no address is created automatically here).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@3

* Applied the B_SOCKET_SET_ALIAS address retrieval logic to B_SOCKET_GET_ALIAS
as well (of course, no address is created automatically here).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38058 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# e8802e49 11-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* datalink_control() also need to accept structures smaller than ifreq as long
as the interface name can be specified.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38015 a95241bf-73f2-0310

* datalink_control() also need to accept structures smaller than ifreq as long
as the interface name can be specified.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38015 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# b0cf274a 06-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Interface::_ChangeAddress() got the address check for equality wrong,
effectively rejecting any try to set an address.
* It now copies the new address as well in order to make sure that its
sa_

* Interface::_ChangeAddress() got the address check for equality wrong,
effectively rejecting any try to set an address.
* It now copies the new address as well in order to make sure that its
sa_len field is set correctly.
* Improved debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37937 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 7aa2819c 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Enabled removing the interface on device removal again.
* Made the return type of remove_interface() void, as it cannot fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37884 a95241bf-73

* Enabled removing the interface on device removal again.
* Made the return type of remove_interface() void, as it cannot fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37884 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 2b1c0755 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed the proprietary SIOC_* ioctls to B_SOCKET_* - no reason to pollute
global name space, and have ugly identifiers for nothing :-)
* Added a flags field to struct ifaliasreq. Added flags to

* Renamed the proprietary SIOC_* ioctls to B_SOCKET_* - no reason to pollute
global name space, and have ugly identifiers for nothing :-)
* Added a flags field to struct ifaliasreq. Added flags to mark an alias that
is currently being configured, or has been automatically configured.
Those flags aren't used yet, but they will replace IFF_CONFIGURING and
friends.
* Implemented deleting addresses only from interfaces via ifconfig.
* Added more command aliases for delete to ifconfig ("del", and "delete", for
more consistency with route).
* Fixed control_routes() to only release a reference to an address if it
actually got one before.
* If an interface address is deleted, its routes are now removed as well.
* InterfaceAddress now holds a reference to its interface as planned.
* Implemented removing interfaces. Works quite nicely.
* When downing an interface, all of its routes are now removed. When upping
it again, at least the default routes are added.
* datalink.cpp's get_interface_name_or_index() leaked a reference to the
interface found.
* SIOCAIFADDR would also leak a reference when new addresses were added.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37872 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 2651e51d 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed net_datalink_module::send_data() to send_routed_data(), and
send_datagram() to send_data().
* Renamed DatagramSocket::SocketEnqueue() to EnqueueClone(), SocketDequeue()
to Dequeue().
*

* Renamed net_datalink_module::send_data() to send_routed_data(), and
send_datagram() to send_data().
* Renamed DatagramSocket::SocketEnqueue() to EnqueueClone(), SocketDequeue()
to Dequeue().
* Ordered the methods in ProtocolUtilities.h according to their declaration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37870 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# cd08b9f7 02-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Work in progress of extending the AF_LINK protocol to be able to send and
receive raw packets (only without the ethernet framing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37853 a952

* Work in progress of extending the AF_LINK protocol to be able to send and
receive raw packets (only without the ethernet framing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37853 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


1234