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"

6
vendor/vendor.json vendored
View file

@ -51,10 +51,10 @@
"revisionTime": "2016-04-24T11:30:07Z"
},
{
"checksumSHA1": "dG2VS6m8AS9wvpZh7aSx5AX001U=",
"checksumSHA1": "87nUxyFGVJFXB6MQpGCGUHi5NY0=",
"path": "github.com/mdlayher/netlink",
"revision": "1291b75abe0cc0cb335f110466bf1f02590c916d",
"revisionTime": "2017-01-04T04:59:06Z"
"revision": "a65cbc3bb3f7a793b7d79ad7d19b16d471ddbd78",
"revisionTime": "2017-01-10T22:29:47Z"
},
{
"checksumSHA1": "+2roeIWCAjCC58tZcs12Vqgf1Io=",