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

Authored by hselasky on Dec 7 2017, 2:44 PM.

Details

Reviewers
kib
glebius
gnn
Group Reviewers
network
Summary

After adding the default IPv6 default link-local address, the kernel is not informed about the new network interface address. Add missing EVENTHANDLER_INVOKE() call to solve this.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 13400
hselasky created this revision.Dec 7 2017, 2:44 PM
kib added a comment.Dec 7 2017, 3:38 PM

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

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 added a comment.Dec 7 2017, 4:59 PM

@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.