Page MenuHomeFreeBSD

if_ovpn: Assert that udp_set_kernel_tunneling() succeeds
ClosedPublic

Authored by markj on Thu, Jul 24, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 9, 3:11 AM
Unknown Object (File)
Mon, Aug 4, 3:48 AM
Unknown Object (File)
Tue, Jul 29, 10:48 AM
Unknown Object (File)
Tue, Jul 29, 1:41 AM
Unknown Object (File)
Tue, Jul 29, 1:40 AM
Unknown Object (File)
Mon, Jul 28, 11:23 PM
Unknown Object (File)
Mon, Jul 28, 2:45 PM
Unknown Object (File)
Mon, Jul 28, 11:44 AM

Details

Summary

We do this elsewhere, so copy the pattern here.

(Perhaps udp_set_kernel_tunneling() should either succeed or panic?)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp accepted this revision as: kp.EditedThu, Jul 24, 5:27 PM

(Perhaps udp_set_kernel_tunneling() should either succeed or panic?)

It currently can't actually fail when we're clearing a tunnel function (as we do here). It can only fail if a tunnel function is already set, which his not something that should happen to the OpenVPN socket.
Some other callers do the same, some attempt to handle the error.
Looking at that code though ... basically everyone creates a new socket and then calls udp_set_kernel_tunneling(). I don't expect it to be possible for those calls to fail, so maybe it would indeed be better to just assert in udp_set_kernel_tunneling() itself.

It looks like if_ovpn is the only case where we don't create the socket before we attach the tunneling function.

This revision is now accepted and ready to land.Thu, Jul 24, 5:27 PM