aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/init.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-02-08 08:47:37 +0100
committerDmitry Vyukov <dvyukov@google.com>2021-02-12 18:09:14 +0100
commit98682e5e2aefc9aad61354f4f3ac93be96002a2a (patch)
tree04d0977ddcf677cc32fe7c8376e79765058406be /sys/linux/init.go
parent394d4bf77bc71747a74968f49ef153a8c9ff0cd4 (diff)
sys/linux: add ieee802154 descriptions
Diffstat (limited to 'sys/linux/init.go')
-rw-r--r--sys/linux/init.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/linux/init.go b/sys/linux/init.go
index 15d6f7960..d3373b5ab 100644
--- a/sys/linux/init.go
+++ b/sys/linux/init.go
@@ -40,6 +40,10 @@ func InitTarget(target *prog.Target) {
AF_AX25: target.GetConst("AF_AX25"),
AF_NETROM: target.GetConst("AF_NETROM"),
AF_ROSE: target.GetConst("AF_ROSE"),
+ AF_IEEE802154: target.GetConst("AF_IEEE802154"),
+ AF_NETLINK: target.GetConst("AF_NETLINK"),
+ SOCK_RAW: target.GetConst("SOCK_RAW"),
+ NETLINK_GENERIC: target.GetConst("NETLINK_GENERIC"),
USB_MAJOR: target.GetConst("USB_MAJOR"),
TIOCSSERIAL: target.GetConst("TIOCSSERIAL"),
TIOCGSERIAL: target.GetConst("TIOCGSERIAL"),
@@ -141,6 +145,10 @@ type arch struct {
AF_AX25 uint64
AF_NETROM uint64
AF_ROSE uint64
+ AF_IEEE802154 uint64
+ AF_NETLINK uint64
+ SOCK_RAW uint64
+ NETLINK_GENERIC uint64
USB_MAJOR uint64
TIOCSSERIAL uint64
TIOCGSERIAL uint64
@@ -200,8 +208,11 @@ func (arch *arch) neutralize(c *prog.Call) {
// Don't let it mess with arbitrary sockets in init namespace.
family := c.Args[0].(*prog.ConstArg)
switch uint64(uint32(family.Val)) {
- case arch.AF_NFC, arch.AF_LLC, arch.AF_BLUETOOTH,
+ case arch.AF_NFC, arch.AF_LLC, arch.AF_BLUETOOTH, arch.AF_IEEE802154,
arch.AF_X25, arch.AF_AX25, arch.AF_NETROM, arch.AF_ROSE:
+ case arch.AF_NETLINK:
+ c.Args[1].(*prog.ConstArg).Val = arch.SOCK_RAW
+ c.Args[2].(*prog.ConstArg).Val = arch.NETLINK_GENERIC
default:
family.Val = ^uint64(0)
}