Page MenuHomeFreeBSD

wg: add a more useful debug message for an unknown family
AcceptedPublic

Authored by kevans on Fri, Dec 19, 10:24 PM.
Tags
None
Referenced Files
F140386445: D54322.id.diff
Tue, Dec 23, 7:29 AM
Unknown Object (File)
Sat, Dec 20, 4:58 AM
Unknown Object (File)
Sat, Dec 20, 4:25 AM
Unknown Object (File)
Sat, Dec 20, 2:23 AM
Unknown Object (File)
Fri, Dec 19, 11:27 PM
Subscribers

Details

Summary

We shouldn't really hit an actually-unknown family unless something
has gone awry on a kernel built without IPv6 support, but one can hit
family == 0 in the wild with valid configurations. Add a new DEBUG
message to call out that scenario specifically, and lay a breadcrumb in
comments for anyone that might be investigating that.

While we're here, just load the remote address family once and use that
in 'all' the places. The send path doesn't require the endpoint lock,
naturally, so it's more satisfying to confirm that we're loading it
once and consistently using the same family from start to finish.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69410
Build 66293: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/dev/wg/if_wg.c
948

What locking is this comment referring to? It sounds a bit stale: e is a pointer to stack copy of the endpoint description, and the copy is made with the endpoint lock held.

This revision is now accepted and ready to land.Mon, Dec 22, 12:50 AM
sys/dev/wg/if_wg.c
948

NET_EPOCH_ENTER perhaps? Also, it's not really getting the local control address so much as it is creating the "local address control message" before the epoch. Saving off a shortcut to a pointer in a local variable, isn't really worth noting here I think (we aren't saving a copy of the remote address, just a pointer to it). I would maybe leave the comment alone in this commit, but possibly tweak it in a followup to something like:

/* Allocate local address control message before entering the network epoch. */

or something like that.