Make every failed check and unreadable counter fatal instead of degrading
This commit is contained in:
@@ -25,7 +25,7 @@ func setBufForce(fd, forceOpt, opt, size int) error {
|
||||
func sockBufSize(fd, opt int) int {
|
||||
v, err := unix.GetsockoptInt(fd, unix.SOL_SOCKET, opt)
|
||||
if err != nil {
|
||||
return -1
|
||||
panic(fmt.Sprintf("reading socket buffer size: %v", err))
|
||||
}
|
||||
return v
|
||||
}
|
||||
@@ -117,7 +117,7 @@ func newMmsghdrs(bufs [][]byte) ([]mmsghdr, []unix.Iovec) {
|
||||
func packetDrops(fd int) uint64 {
|
||||
st, err := unix.GetsockoptTpacketStats(fd, unix.SOL_PACKET, unix.PACKET_STATISTICS)
|
||||
if err != nil {
|
||||
return 0
|
||||
panic(fmt.Sprintf("reading packet drop statistics: %v", err))
|
||||
}
|
||||
return uint64(st.Drops)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user