Page MenuHomeFreeBSD

Add missing network interface address event for adding default IPv6 link-local addresses
ClosedPublic

Authored by hselasky on Dec 7 2017, 2:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 9:28 PM
Unknown Object (File)
Feb 13 2024, 10:42 PM
Unknown Object (File)
Jan 16 2024, 7:01 PM
Unknown Object (File)
Jan 8 2024, 7:09 PM
Unknown Object (File)
Jan 8 2024, 10:27 AM
Unknown Object (File)
Jan 8 2024, 10:24 AM
Unknown Object (File)
Jan 8 2024, 10:24 AM
Unknown Object (File)
Dec 22 2023, 9:23 PM
Subscribers

Details

Summary

After adding the default IPv6 default link-local address, the kernel is not informed about the new network interface address. Move the EVENTHANDLER_INVOKE() call to a more appropriate location.

This event is needed by ibcore which regularly listen for network address changes.
The issue manifests itself when creating a VLAN network interface and configuring a IPv4 address only which also brings up the IPv6 link-local address, but the ifaddr_event is not invoked for the latter and then ibcore will not see the IPv6 link-local address added only the IPv4 one.

Sponsored by: Mellanox Technologies

Test Plan

Test OK.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 16474

Event Timeline

For my understanding of this stuff. Is some lock which guarantees consistency for the addresses configuration is still held while the eventhandler is invoked ? What is the lock ?

netinet6/in6_ifattach.c
550 ↗(On Diff #36337)

The comment is actually useless. It is quite obvious for any reader that an eventhandler is called, so the text repeats the code.

@kib: Other places where "EVENTHANDLER_INVOKE(ifaddr_event, ifp)" is used there are no locks involved from what I can see. Correct me if I'm wrong.

@kib: Other places where "EVENTHANDLER_INVOKE(ifaddr_event, ifp)" is used there are no locks involved from what I can see. Correct me if I'm wrong.

Then how e.g. validity of ifp is ensured for the duration of the eventhandler callback ? Also, do eventhandlers re-check the condition they are called for ?

If not, this is quite hideous.

Then how e.g. validity of ifp is ensured for the duration of the eventhandler callback ? Also, do eventhandlers re-check the condition they are called for ?

If not, this is quite hideous.

The "ifp" pointer is already used several times inside the same function, so I assume it is safe to call the eventhandler with this network interface pointer aswell.

Remove useless comment as per KIB's suggestion.

I've checked the callers of in6_ifattach_linklocal(), and there appears to be no fast path involved, which means among others that sleeping is OK inside the eventhandler callbacks.

This revision is now accepted and ready to land.May 8 2018, 8:48 AM
hselasky edited the summary of this revision. (Show Details)

Implement suggestion from ae@

This revision now requires review to proceed.May 8 2018, 10:44 AM

Remove superfluous eventhandler call.

Suggested by: ae@

This revision is now accepted and ready to land.May 8 2018, 11:01 AM
This revision was automatically updated to reflect the committed changes.