mirror of
https://github.com/bettercap/bettercap
synced 2025-07-29 19:20:00 -07:00
misc: updated deps
This commit is contained in:
parent
b8e5872040
commit
c3a4dc8cf5
22 changed files with 218 additions and 48 deletions
9
vendor/github.com/mdlayher/raw/raw_linux.go
generated
vendored
9
vendor/github.com/mdlayher/raw/raw_linux.go
generated
vendored
|
@ -53,6 +53,13 @@ type socket interface {
|
|||
SetTimeout(time.Duration) error
|
||||
}
|
||||
|
||||
// htons converts a short (uint16) from host-to-network byte order.
|
||||
// Thanks to mikioh for this neat trick:
|
||||
// https://github.com/mikioh/-stdyng/blob/master/afpacket.go
|
||||
func htons(i uint16) uint16 {
|
||||
return (i<<8)&0xff00 | i>>8
|
||||
}
|
||||
|
||||
// listenPacket creates a net.PacketConn which can be used to send and receive
|
||||
// data at the device driver level.
|
||||
func listenPacket(ifi *net.Interface, proto uint16, cfg Config) (*packetConn, error) {
|
||||
|
@ -124,7 +131,7 @@ func (p *packetConn) ReadFrom(b []byte) (int, net.Addr, error) {
|
|||
|
||||
for {
|
||||
if !deadline.IsZero() {
|
||||
timeout = deadline.Sub(time.Now())
|
||||
timeout = time.Until(deadline)
|
||||
if timeout > readTimeout {
|
||||
timeout = readTimeout
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue