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:
parent
7c5cecc0f9
commit
c084ac2883
@ -52,7 +52,7 @@ main(void)
|
|||||||
sock);
|
sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errno != EPROTONOSUPPORT)
|
if (errno != EPROTOTYPE)
|
||||||
err(-1, "socket(PF_ROUTE, SOCK_STREAM, 0)");
|
err(-1, "socket(PF_ROUTE, SOCK_STREAM, 0)");
|
||||||
|
|
||||||
sock = socket(PF_ROUTE, SOCK_DGRAM, 0);
|
sock = socket(PF_ROUTE, SOCK_DGRAM, 0);
|
||||||
@ -62,7 +62,7 @@ main(void)
|
|||||||
sock);
|
sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errno != EPROTONOSUPPORT)
|
if (errno != EPROTOTYPE)
|
||||||
err(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0)");
|
err(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0)");
|
||||||
|
|
||||||
sock = socket(PF_ROUTE, SOCK_RAW, 0);
|
sock = socket(PF_ROUTE, SOCK_RAW, 0);
|
||||||
@ -77,7 +77,7 @@ main(void)
|
|||||||
"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success");
|
"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errno != EPROTONOSUPPORT)
|
if (errno != EPROTOTYPE)
|
||||||
err(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)");
|
err(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)");
|
||||||
|
|
||||||
if (socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) == 0) {
|
if (socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) == 0) {
|
||||||
@ -87,7 +87,7 @@ main(void)
|
|||||||
"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success");
|
"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errno != EPROTONOSUPPORT)
|
if (errno != EPROTOTYPE)
|
||||||
err(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)");
|
err(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)");
|
||||||
|
|
||||||
if (socketpair(PF_ROUTE, SOCK_RAW, 0, socks) == 0) {
|
if (socketpair(PF_ROUTE, SOCK_RAW, 0, socks) == 0) {
|
||||||
|
@ -59,7 +59,7 @@ main(void)
|
|||||||
close(sock);
|
close(sock);
|
||||||
errx(-1, "socket(PF_LOCAL, SOCK_RAW, 0) returned %d", 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)");
|
err(-1, "socket(PF_LOCAL, SOCK_RAW, 0)");
|
||||||
|
|
||||||
if (socketpair(PF_LOCAL, SOCK_STREAM, 0, socks) < 0)
|
if (socketpair(PF_LOCAL, SOCK_STREAM, 0, socks) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user