Add initial wifi collector, bump netlink to fix 32-bit builds

This commit is contained in:
Matt Layher 2017-01-09 14:37:59 -05:00
commit efa25665ec
No known key found for this signature in database
GPG key ID: 77BFE531397EDE94
9 changed files with 337 additions and 7 deletions

View file

@ -2,7 +2,6 @@ package netlink
import (
"errors"
"math"
"os"
"sync/atomic"
)
@ -102,8 +101,8 @@ func (c *Conn) Execute(m Message) ([]Message, error) {
func (c *Conn) Send(m Message) (Message, error) {
ml := nlmsgLength(len(m.Data))
// TODO(mdlayher): fine-tune this limit. ~4GiB is a huge message.
if ml > math.MaxUint32 {
// TODO(mdlayher): fine-tune this limit.
if ml > (1024 * 32) {
return Message{}, errors.New("netlink message data too large")
}

View file

@ -4,7 +4,7 @@
// +build linux,386
package raw
package netlink
import (
"syscall"