search for: sotoinpcb

Displaying 1 result from an estimated 1 matches for "sotoinpcb".

2004 Nov 21
1
mac_portacl and automatic port allocation
...000 @@ -79,6 +79,7 @@ #include <sys/sysctl.h> #include <netinet/in.h> +#include <netinet/in_pcb.h> #include <vm/vm.h> @@ -441,6 +442,7 @@ struct label *socketlabel, struct sockaddr *sockaddr) { struct sockaddr_in *sin; + struct inpcb *inp = sotoinpcb(so); int family, type; u_int16_t port; @@ -467,6 +469,11 @@ type = so->so_type; sin = (struct sockaddr_in *) sockaddr; port = ntohs(sin->sin_port); + /* If port == 0 and user hasn't asked for IP_PORTRANGELOW return + success */ +...