feat(tun): mention in 'operation not permitted' error the user should specify --device /dev/net/tun
This commit is contained in:
@@ -34,6 +34,9 @@ func (t *Tun) Create(path string) (err error) {
|
|||||||
|
|
||||||
fd, err := unix.Open(path, 0, 0)
|
fd, err := unix.Open(path, 0, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err.Error() == "operation not permitted" {
|
||||||
|
err = fmt.Errorf("%w (did you specify --device /dev/net/tun to your container command?)", err)
|
||||||
|
}
|
||||||
return fmt.Errorf("unix opening TUN device file: %w", err)
|
return fmt.Errorf("unix opening TUN device file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user