diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-01-19 13:47:56 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-01-19 13:51:21 +0100 |
| commit | 0342f8c7bc656ea8ee3c45e49edeb4ee9cc12cce (patch) | |
| tree | 11e5b0db75e24ed6ec93edab48d6a8ee1113a456 /executor | |
| parent | bc8bc756c272115ed92fad4f716b77f6fb995203 (diff) | |
sys/linux: add more device descriptions (geneve, lowpan, ipoib, cfhsi)
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_linux.h | 37 | ||||
| -rw-r--r-- | executor/defs.h | 12 | ||||
| -rw-r--r-- | executor/syscalls.h | 24 |
3 files changed, 63 insertions, 10 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index e8fa063f6..bf56cb00c 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -317,6 +317,23 @@ static void netlink_add_macvlan(struct nlmsg* nlmsg, int sock, const char* name, (void)err; } +static void netlink_add_geneve(struct nlmsg* nlmsg, int sock, const char* name, uint32 vni, struct in_addr* addr4, struct in6_addr* addr6) +{ + netlink_add_device_impl(nlmsg, "geneve", name); + netlink_nest(nlmsg, IFLA_INFO_DATA); + netlink_attr(nlmsg, IFLA_GENEVE_ID, &vni, sizeof(vni)); + if (addr4) + netlink_attr(nlmsg, IFLA_GENEVE_REMOTE, addr4, sizeof(*addr4)); + if (addr6) + netlink_attr(nlmsg, IFLA_GENEVE_REMOTE6, addr6, sizeof(*addr6)); + netlink_done(nlmsg); + netlink_done(nlmsg); + int err = netlink_send(nlmsg, sock); + debug("netlink: add %s type geneve vni %u: %s\n", + name, vni, strerror(err)); + (void)err; +} + #define IFLA_IPVLAN_FLAGS 2 #define IPVLAN_MODE_L3S 2 #undef IPVLAN_F_VEPA @@ -739,11 +756,9 @@ static void initialize_netdevices(void) #endif // TODO: add the following devices: // - vxlan - // - macsec // - ipip - // - lowpan - // - ipoib - // - geneve + // - lowpan (requires link to device of type IEEE802154, e.g. wpan0) + // - ipoib (requires link to device of type ARPHRD_INFINIBAND) // - vrf // - rmnet // - openvswitch @@ -840,6 +855,8 @@ static void initialize_netdevices(void) {"veth1_to_batadv", ETH_ALEN}, {"batadv_slave_0", ETH_ALEN}, {"batadv_slave_1", ETH_ALEN}, + {"geneve0", ETH_ALEN}, + {"geneve1", ETH_ALEN}, }; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) @@ -890,6 +907,18 @@ static void initialize_netdevices(void) netlink_add_linked(&nlmsg, sock, "macvtap", "macvtap0", "veth0_macvtap"); netlink_add_linked(&nlmsg, sock, "macsec", "macsec0", "veth1_macvtap"); + char addr[32]; + sprintf(addr, DEV_IPV4, 14 + 10); // should point to veth0 + struct in_addr geneve_addr4; + if (inet_pton(AF_INET, addr, &geneve_addr4) <= 0) + fail("geneve0 inet_pton failed"); + struct in6_addr geneve_addr6; + // Must not be link local (our device addresses are link local). + if (inet_pton(AF_INET6, "fc00::01", &geneve_addr6) <= 0) + fail("geneve1 inet_pton failed"); + netlink_add_geneve(&nlmsg, sock, "geneve0", 0, &geneve_addr4, 0); + netlink_add_geneve(&nlmsg, sock, "geneve1", 1, 0, &geneve_addr6); + netdevsim_add((int)procid, 4); // Number of port is in sync with value in sys/linux/socket_netlink_generic_devlink.txt for (i = 0; i < sizeof(devices) / (sizeof(devices[0])); i++) { diff --git a/executor/defs.h b/executor/defs.h index af02f2e85..8bb65bc91 100644 --- a/executor/defs.h +++ b/executor/defs.h @@ -70,7 +70,7 @@ #if GOARCH_386 #define GOARCH "386" -#define SYZ_REVISION "d519e4fa787c6c2ec607f9e928ab2c165e17f4e5" +#define SYZ_REVISION "7a16ee061356e36ab4a909ca3e22a83201947747" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -80,7 +80,7 @@ #if GOARCH_amd64 #define GOARCH "amd64" -#define SYZ_REVISION "268924144a14079b6a9014d77c97e18b11cfaa9e" +#define SYZ_REVISION "2587f9c675f532d274dad4baaa6e6f1ffe998217" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -90,7 +90,7 @@ #if GOARCH_arm #define GOARCH "arm" -#define SYZ_REVISION "bf2ffccb00289cd4823322f39c4e36ee9048e12b" +#define SYZ_REVISION "f6a28f6aeb66e89aeaeb3e5a1175107244cf80f6" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -100,7 +100,7 @@ #if GOARCH_arm64 #define GOARCH "arm64" -#define SYZ_REVISION "03ddfe809f399ada229c67331cf1ef46d43bc454" +#define SYZ_REVISION "e2c8f572ca948eadfe0315c4e0dbd88d012f1096" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -110,7 +110,7 @@ #if GOARCH_mips64le #define GOARCH "mips64le" -#define SYZ_REVISION "b069e588addbcd63c1499b1921cb5a9228ef2147" +#define SYZ_REVISION "882114fc35c868da406afe54562c7d51ce0d0652" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -120,7 +120,7 @@ #if GOARCH_ppc64le #define GOARCH "ppc64le" -#define SYZ_REVISION "e1de4a24cccbd364a871e22f7b2a59879b3d0932" +#define SYZ_REVISION "269f710e7e2bb00dfa01c523577de9694e851cf2" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 diff --git a/executor/syscalls.h b/executor/syscalls.h index 7d8c4cdce..7c24fa32b 100644 --- a/executor/syscalls.h +++ b/executor/syscalls.h @@ -3908,6 +3908,8 @@ const call_t syscalls[] = { {"open_by_handle_at", 342}, {"open_tree", 428}, {"openat", 295}, + {"openat$6lowpan_control", 295}, + {"openat$6lowpan_enable", 295}, {"openat$adsp1", 295}, {"openat$apparmor_task_current", 295}, {"openat$apparmor_task_exec", 295}, @@ -5082,6 +5084,8 @@ const call_t syscalls[] = { {"waitid$P_PIDFD", 284}, {"watch_devices", 436}, {"write", 4}, + {"write$6lowpan_control", 4}, + {"write$6lowpan_enable", 4}, {"write$9p", 4}, {"write$ALLOC_MW", 4}, {"write$ALLOC_PD", 4}, @@ -7158,6 +7162,8 @@ const call_t syscalls[] = { {"open_by_handle_at", 304}, {"open_tree", 428}, {"openat", 257}, + {"openat$6lowpan_control", 257}, + {"openat$6lowpan_enable", 257}, {"openat$adsp1", 257}, {"openat$apparmor_task_current", 257}, {"openat$apparmor_task_exec", 257}, @@ -8332,6 +8338,8 @@ const call_t syscalls[] = { {"waitid$P_PIDFD", 247}, {"watch_devices", 436}, {"write", 1}, + {"write$6lowpan_control", 1}, + {"write$6lowpan_enable", 1}, {"write$9p", 1}, {"write$ALLOC_MW", 1}, {"write$ALLOC_PD", 1}, @@ -10361,6 +10369,8 @@ const call_t syscalls[] = { {"open_by_handle_at", 371}, {"open_tree", 428}, {"openat", 322}, + {"openat$6lowpan_control", 322}, + {"openat$6lowpan_enable", 322}, {"openat$adsp1", 322}, {"openat$apparmor_task_current", 322}, {"openat$apparmor_task_exec", 322}, @@ -11532,6 +11542,8 @@ const call_t syscalls[] = { {"waitid$P_PIDFD", 280}, {"watch_devices", 436}, {"write", 4}, + {"write$6lowpan_control", 4}, + {"write$6lowpan_enable", 4}, {"write$9p", 4}, {"write$ALLOC_MW", 4}, {"write$ALLOC_PD", 4}, @@ -13550,6 +13562,8 @@ const call_t syscalls[] = { {"open_by_handle_at", 265}, {"open_tree", 428}, {"openat", 56}, + {"openat$6lowpan_control", 56}, + {"openat$6lowpan_enable", 56}, {"openat$adsp1", 56}, {"openat$apparmor_task_current", 56}, {"openat$apparmor_task_exec", 56}, @@ -14704,6 +14718,8 @@ const call_t syscalls[] = { {"waitid$P_PIDFD", 95}, {"watch_devices", 436}, {"write", 64}, + {"write$6lowpan_control", 64}, + {"write$6lowpan_enable", 64}, {"write$9p", 64}, {"write$ALLOC_MW", 64}, {"write$ALLOC_PD", 64}, @@ -16629,6 +16645,8 @@ const call_t syscalls[] = { {"open_by_handle_at", 5299}, {"open_tree", 5428}, {"openat", 5247}, + {"openat$6lowpan_control", 5247}, + {"openat$6lowpan_enable", 5247}, {"openat$adsp1", 5247}, {"openat$apparmor_task_current", 5247}, {"openat$apparmor_task_exec", 5247}, @@ -17800,6 +17818,8 @@ const call_t syscalls[] = { {"waitid$P_PIDFD", 5237}, {"watch_devices", 5436}, {"write", 5001}, + {"write$6lowpan_control", 5001}, + {"write$6lowpan_enable", 5001}, {"write$9p", 5001}, {"write$ALLOC_MW", 5001}, {"write$ALLOC_PD", 5001}, @@ -19829,6 +19849,8 @@ const call_t syscalls[] = { {"open_by_handle_at", 346}, {"open_tree", 428}, {"openat", 286}, + {"openat$6lowpan_control", 286}, + {"openat$6lowpan_enable", 286}, {"openat$adsp1", 286}, {"openat$apparmor_task_current", 286}, {"openat$apparmor_task_exec", 286}, @@ -21000,6 +21022,8 @@ const call_t syscalls[] = { {"waitid$P_PIDFD", 272}, {"watch_devices", 436}, {"write", 4}, + {"write$6lowpan_control", 4}, + {"write$6lowpan_enable", 4}, {"write$9p", 4}, {"write$ALLOC_MW", 4}, {"write$ALLOC_PD", 4}, |
