1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Test for EPROTOTYPE not EPROTONOSUPPORT

- `SOCK_RAW` is the implied supported type parameter for socket(2) per route(4)
- localsw in `sys/kern/uipc_usrreq.c` doesn't have an entry for `SOCK_RAW`, so
  the prototype is invalid (this isn't explicitly documented anywhere I could
  find)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-01-16 02:02:50 +00:00
parent 7c5cecc0f9
commit c084ac2883
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294125
2 changed files with 5 additions and 5 deletions

View File

@ -52,7 +52,7 @@ main(void)
sock);
}
if (errno != EPROTONOSUPPORT)
if (errno != EPROTOTYPE)
err(-1, "socket(PF_ROUTE, SOCK_STREAM, 0)");
sock = socket(PF_ROUTE, SOCK_DGRAM, 0);
@ -62,7 +62,7 @@ main(void)
sock);
}
if (errno != EPROTONOSUPPORT)
if (errno != EPROTOTYPE)
err(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0)");
sock = socket(PF_ROUTE, SOCK_RAW, 0);
@ -77,7 +77,7 @@ main(void)
"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success");
}
if (errno != EPROTONOSUPPORT)
if (errno != EPROTOTYPE)
err(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)");
if (socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) == 0) {
@ -87,7 +87,7 @@ main(void)
"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success");
}
if (errno != EPROTONOSUPPORT)
if (errno != EPROTOTYPE)
err(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)");
if (socketpair(PF_ROUTE, SOCK_RAW, 0, socks) == 0) {

View File

@ -59,7 +59,7 @@ main(void)
close(sock);
errx(-1, "socket(PF_LOCAL, SOCK_RAW, 0) returned %d", sock);
}
if (errno != EPROTONOSUPPORT)
if (errno != EPROTOTYPE)
err(-1, "socket(PF_LOCAL, SOCK_RAW, 0)");
if (socketpair(PF_LOCAL, SOCK_STREAM, 0, socks) < 0)