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)
Sat, Nov 16, 12:45 AM
Unknown Object (File)
Tue, Oct 29, 5:20 AM
Unknown Object (File)
Oct 6 2024, 3:58 AM
Unknown Object (File)
Oct 3 2024, 6:29 AM
Unknown Object (File)
Oct 3 2024, 5:44 AM
Unknown Object (File)
Oct 1 2024, 7:23 AM
Unknown Object (File)
Sep 22 2024, 6:45 AM
Unknown Object (File)
Sep 18 2024, 8:32 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 16475

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.