restrict is a keyword
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10647 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -302,7 +302,7 @@ void
|
|||||||
socket_set_port (struct sockaddr *sa, int port);
|
socket_set_port (struct sockaddr *sa, int port);
|
||||||
|
|
||||||
void
|
void
|
||||||
socket_set_portrange (int sock, int restrict, int af);
|
socket_set_portrange (int sock, int restr, int af);
|
||||||
|
|
||||||
void
|
void
|
||||||
socket_set_debug (int sock);
|
socket_set_debug (int sock);
|
||||||
|
@@ -225,11 +225,11 @@ socket_set_port (struct sockaddr *sa, int port)
|
|||||||
* Set the range of ports to use when binding with port = 0.
|
* Set the range of ports to use when binding with port = 0.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
socket_set_portrange (int sock, int restrict, int af)
|
socket_set_portrange (int sock, int restr, int af)
|
||||||
{
|
{
|
||||||
#if defined(IP_PORTRANGE)
|
#if defined(IP_PORTRANGE)
|
||||||
if (af == AF_INET) {
|
if (af == AF_INET) {
|
||||||
int on = restrict ? IP_PORTRANGE_HIGH : IP_PORTRANGE_DEFAULT;
|
int on = restr ? IP_PORTRANGE_HIGH : IP_PORTRANGE_DEFAULT;
|
||||||
if (setsockopt (sock, IPPROTO_IP, IP_PORTRANGE, &on,
|
if (setsockopt (sock, IPPROTO_IP, IP_PORTRANGE, &on,
|
||||||
sizeof(on)) < 0)
|
sizeof(on)) < 0)
|
||||||
warn ("setsockopt IP_PORTRANGE (ignored)");
|
warn ("setsockopt IP_PORTRANGE (ignored)");
|
||||||
@@ -237,7 +237,7 @@ socket_set_portrange (int sock, int restrict, int af)
|
|||||||
#endif
|
#endif
|
||||||
#if defined(IPV6_PORTRANGE)
|
#if defined(IPV6_PORTRANGE)
|
||||||
if (af == AF_INET6) {
|
if (af == AF_INET6) {
|
||||||
int on = restrict ? IPV6_PORTRANGE_HIGH :
|
int on = restr ? IPV6_PORTRANGE_HIGH :
|
||||||
IPV6_PORTRANGE_DEFAULT;
|
IPV6_PORTRANGE_DEFAULT;
|
||||||
if (setsockopt (sock, IPPROTO_IPV6, IPV6_PORTRANGE, &on,
|
if (setsockopt (sock, IPPROTO_IPV6, IPV6_PORTRANGE, &on,
|
||||||
sizeof(on)) < 0)
|
sizeof(on)) < 0)
|
||||||
|
Reference in New Issue
Block a user