Page MenuHomeFreeBSD

Schedule link address update when vlan's parent interface is changed
ClosedPublic

Authored by ae on Tue, Nov 5, 4:07 PM.

Details

Summary

We discovered the problem: when vlan's parent interface is changed, vlans still use old link layer address since vlan_lladdr_fn is not executed.

This patch adds the check and enqueues lladdr_task if L2 address is different.

This is how to reproduce:

# ifconfig vlan1 create vlandev mce3 vlan 1
# ifconfig vlan1 inet 10.0.0.1/24
# ifconfig vlan1 inet6 fc00::1
# (ndp -an; arp -an) | grep vlan1
# ifconfig vlan1 -vlandev
# ifconfig vlan1 vlandev ix1 vlan1
# (ndp -an; arp -an) | grep vlan1

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ae created this revision.Tue, Nov 5, 4:07 PM
ae edited the summary of this revision. (Show Details)Tue, Nov 5, 4:07 PM

If copying the LL addr is happening every time a parent interface is added (bcopy) , why not schedule the update too unconditionally?
It will only happen on changing the parent interface anyway.

ae added a comment.Tue, Nov 5, 4:53 PM

If copying the LL addr is happening every time a parent interface is added (bcopy) , why not schedule the update too unconditionally?
It will only happen on changing the parent interface anyway.

Yes, we can do it unconditionally. I just tried to avoid extra work (updating of each llentry), that can be done in case when interface has tens or hundreds of addresses.

I just tried to avoid extra work (updating of each llentry), that can be done in case when interface has tens or hundreds of addresses.

Then please skip the bcopy, too. Otherwise it looks inconsistent.
if(!memcmp(...)) { bcopy(); schedule_update(); }

ae updated this revision to Diff 63994.Wed, Nov 6, 9:29 AM

Make address copying also conditional for consistency.
Add comment describing the goal of condition.

Okay from me.
Now you need to find some of the senior developers to approve and commit it.

This revision was not accepted when it landed; it landed in state Needs Review.Thu, Nov 7, 3:00 PM
This revision was automatically updated to reflect the committed changes.