Skip to content

Commit

Permalink
tun: darwin: filter ENOBUFS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokeqx committed Dec 18, 2024
1 parent 12269c2 commit dd4751c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tun/tun_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type NativeTun struct {
func retryInterfaceByIndex(index int) (iface *net.Interface, err error) {
for i := 0; i < 20; i++ {
iface, err = net.InterfaceByIndex(index)
if err != nil && errors.Is(err, unix.ENOMEM) {
if err != nil && (errors.Is(err, unix.ENOMEM) || errors.Is(err, unix.ENOBUFS)) {
time.Sleep(time.Duration(i) * time.Second / 3)
continue
}
Expand Down

0 comments on commit dd4751c

Please sign in to comment.