diff options
author | Patrick Mooney <patrick.f.mooney@gmail.com> | 2015-07-21 17:20:52 +0000 |
---|---|---|
committer | Patrick Mooney <patrick.f.mooney@gmail.com> | 2015-07-21 18:47:04 +0000 |
commit | 37f31c3387f87039d4a18bf0ffb957aa90140543 (patch) | |
tree | 08e7e2d5fb6de5137191ee24c9910eae22212f49 | |
parent | 6a1084147a2c54ddb0dbc4918b5405bb861fff8f (diff) | |
download | illumos-joyent-37f31c3387f87039d4a18bf0ffb957aa90140543.tar.gz |
OS-4511 lxbrand golang stumbles over netlink
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
-rw-r--r-- | usr/src/uts/common/brand/lx/sys/lx_socket.h | 13 | ||||
-rw-r--r-- | usr/src/uts/common/brand/lx/syscall/lx_socket.c | 94 |
2 files changed, 86 insertions, 21 deletions
diff --git a/usr/src/uts/common/brand/lx/sys/lx_socket.h b/usr/src/uts/common/brand/lx/sys/lx_socket.h index db024198b7..9fa574439c 100644 --- a/usr/src/uts/common/brand/lx/sys/lx_socket.h +++ b/usr/src/uts/common/brand/lx/sys/lx_socket.h @@ -47,11 +47,12 @@ extern "C" { #define LX_AF_X25 9 /* X.25 */ #define LX_AF_INET6 10 /* IPV 6 */ #define LX_AF_ROSE 11 /* Amateur Radio X.25 */ -#define LX_AF_DECnet 12 /* DECnet */ +#define LX_AF_DECNET 12 /* DECnet */ #define LX_AF_NETBEUI 13 /* 802.2LLC */ #define LX_AF_SECURITY 14 /* Security callback */ #define LX_AF_KEY 15 /* key management */ #define LX_AF_ROUTE 16 /* Alias to emulate 4.4BSD */ +#define LX_AF_NETLINK LX_AF_ROUTE #define LX_AF_PACKET 17 /* Packet family */ #define LX_AF_ASH 18 /* Ash ? */ #define LX_AF_ECONET 19 /* Acorn Econet */ @@ -60,8 +61,16 @@ extern "C" { #define LX_AF_IRDA 23 /* IRDA sockets */ #define LX_AF_PPPOX 24 /* PPPoX sockets */ #define LX_AF_WANPIPE 25 /* Wanpipe API sockets */ +#define LX_AF_LLC 26 +/* gap in Linux defines for 27 and 28 */ +#define LX_AF_CAN 29 +#define LX_AF_TIPC 30 #define LX_AF_BLUETOOTH 31 /* Bluetooth sockets */ -#define LX_AF_MAX 32 /* MAX socket type */ +#define LX_AF_IUCV 32 +#define LX_AF_RXRPC 33 + +/* limit of AF mappings */ +#define LX_AF_MAX LX_AF_RXRPC #define AF_NOTSUPPORTED -1 #define AF_INVAL -2 diff --git a/usr/src/uts/common/brand/lx/syscall/lx_socket.c b/usr/src/uts/common/brand/lx/syscall/lx_socket.c index 07a329011e..180cffe6c6 100644 --- a/usr/src/uts/common/brand/lx/syscall/lx_socket.c +++ b/usr/src/uts/common/brand/lx/syscall/lx_socket.c @@ -85,28 +85,84 @@ typedef enum lx_xlate_dir { * and Unix networking even more so. */ static const int ltos_family[LX_AF_MAX + 1] = { - AF_UNSPEC, AF_UNIX, AF_INET, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_INET6, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_LX_NETLINK, - AF_PACKET, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED + AF_UNSPEC, /* LX_AF_UNSPEC */ + AF_UNIX, /* LX_AF_UNIX */ + AF_INET, /* LX_AF_INET */ + AF_NOTSUPPORTED, /* LX_AF_AX25 */ + AF_NOTSUPPORTED, /* LX_AF_IPX */ + AF_NOTSUPPORTED, /* LX_AF_APPLETALK */ + AF_NOTSUPPORTED, /* LX_AF_NETROM */ + AF_NOTSUPPORTED, /* LX_AF_BRIDGE */ + AF_NOTSUPPORTED, /* LX_AF_ATMPVC */ + AF_NOTSUPPORTED, /* LX_AF_X25 */ + AF_INET6, /* LX_AF_INET6 */ + AF_NOTSUPPORTED, /* LX_AF_ROSE */ + AF_NOTSUPPORTED, /* LX_AF_DECNET */ + AF_NOTSUPPORTED, /* LX_AF_NETBEUI */ + AF_NOTSUPPORTED, /* LX_AF_SECURITY */ + AF_NOTSUPPORTED, /* LX_AF_KEY */ + AF_LX_NETLINK, /* LX_AF_NETLINK */ + AF_PACKET, /* LX_AF_PACKET */ + AF_NOTSUPPORTED, /* LX_AF_ASH */ + AF_NOTSUPPORTED, /* LX_AF_ECONET */ + AF_NOTSUPPORTED, /* LX_AF_ATMSVC */ + AF_NOTSUPPORTED, /* LX_AF_RDS */ + AF_NOTSUPPORTED, /* LX_AF_SNA */ + AF_NOTSUPPORTED, /* LX_AF_IRDA */ + AF_NOTSUPPORTED, /* LX_AF_PPOX */ + AF_NOTSUPPORTED, /* LX_AF_WANPIPE */ + AF_NOTSUPPORTED, /* LX_AF_LLC */ + AF_NOTSUPPORTED, /* EMPTY */ + AF_NOTSUPPORTED, /* EMPTY */ + AF_NOTSUPPORTED, /* LX_AF_CAN */ + AF_NOTSUPPORTED, /* LX_AF_TIPC */ + AF_NOTSUPPORTED, /* LX_AF_BLUETOOTH */ + AF_NOTSUPPORTED, /* LX_AF_IUCV */ + AF_NOTSUPPORTED /* LX_AF_RXRPC */ + /* LX_AF_ISDN */ + /* LX_AF_PHONET */ + /* LX_AF_IEEE802154 */ + /* LX_AF_CAIF */ + /* LX_AF_ALG */ + /* LX_AF_NFC */ + /* LX_AF_VSOCK */ }; -#define LX_AF_INET6 10 -#define LX_AF_PACKET 17 - static const int stol_family[LX_AF_MAX + 1] = { - AF_UNSPEC, AF_UNIX, AF_INET, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_LX_NETLINK, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, LX_AF_INET6, AF_NOTSUPPORTED, AF_NOTSUPPORTED, - AF_NOTSUPPORTED, AF_NOTSUPPORTED, AF_NOTSUPPORTED, LX_AF_PACKET + AF_UNSPEC, /* AF_UNSPEC */ + AF_UNIX, /* AF_UNIX */ + AF_INET, /* AF_INET */ + AF_NOTSUPPORTED, /* AF_IMPLINK */ + AF_NOTSUPPORTED, /* AF_PUP */ + AF_NOTSUPPORTED, /* AF_CHAOS */ + AF_NOTSUPPORTED, /* AF_NS */ + AF_NOTSUPPORTED, /* AF_NBS */ + AF_NOTSUPPORTED, /* AF_ECMA */ + AF_NOTSUPPORTED, /* AF_DATAKIT */ + AF_NOTSUPPORTED, /* AF_CCITT */ + AF_NOTSUPPORTED, /* AF_SNA */ + AF_NOTSUPPORTED, /* AF_DECNET */ + AF_NOTSUPPORTED, /* AF_DLI */ + AF_NOTSUPPORTED, /* AF_LAT */ + AF_NOTSUPPORTED, /* AF_HYLINK */ + AF_NOTSUPPORTED, /* AF_APPLETALK */ + AF_NOTSUPPORTED, /* AF_NIT */ + AF_NOTSUPPORTED, /* AF_802 */ + AF_NOTSUPPORTED, /* AF_OSI */ + AF_NOTSUPPORTED, /* AF_X25 */ + AF_NOTSUPPORTED, /* AF_OSINET */ + AF_NOTSUPPORTED, /* AF_GOSIP */ + AF_NOTSUPPORTED, /* AF_IPX */ + AF_NOTSUPPORTED, /* AF_ROUTE */ + AF_NOTSUPPORTED, /* AF_LINK */ + LX_AF_INET6, /* AF_INET6 */ + AF_NOTSUPPORTED, /* AF_KEY */ + AF_NOTSUPPORTED, /* AF_NCA */ + AF_NOTSUPPORTED, /* AF_POLICY */ + AF_NOTSUPPORTED, /* AF_INET_OFFLOAD */ + AF_NOTSUPPORTED, /* AF_TRILL */ + LX_AF_PACKET, /* AF_PACKET */ + LX_AF_NETLINK /* AF_LX_NETLINK */ }; #define LTOS_FAMILY(d) ((d) <= LX_AF_MAX ? ltos_family[(d)] : AF_INVAL) |