mdlayher / raw

Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed.
MIT License
425 stars 71 forks source link

Increase potential BFP devices from 11 to 256 #54

Closed hyperized closed 5 years ago

hyperized commented 5 years ago

My Darwin BSD has devices bpf0,1 and then only bpf10 available in this range. With other processes taking up some sockets I'm running into an unable to open BPF device at times.

I do however have room to go up to 256 BPF devices available. So this PR is a suggestion to take it up from 0 to 255 to find the first available device.

➜  /dev ls | grep bpf | wc -l
     256

Alternatively a file listing could be done in the directory prior to setting the for loop limit.

Thank you for considering

hyperized commented 5 years ago

Thank you!