summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_domain.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2006-02-18 17:16:18 +0000
committerandre <andre@FreeBSD.org>2006-02-18 17:16:18 +0000
commit6f25a951392d9da6e7c7603e3ac5f6887a808328 (patch)
tree6c594df5859b7264d04576d77ddafc68c86be436 /sys/kern/uipc_domain.c
parenta8296c797205758f4716e8554c70740ae7decab8 (diff)
downloadFreeBSD-src-6f25a951392d9da6e7c7603e3ac5f6887a808328.zip
FreeBSD-src-6f25a951392d9da6e7c7603e3ac5f6887a808328.tar.gz
The sysctls kern.ipc.[max_linkhdr|max_protohdr|max_hdr|max_datalen]
can't be changed from userland. Make them read-only and provide descriptions. kern.ipc.max_datalen must never be less than one byte. Enforce this with a panic in net_init_domain(). Sponsored by: TCP/IP Optimization Fundraise 2005 MFC after: 3 days
Diffstat (limited to 'sys/kern/uipc_domain.c')
-rw-r--r--sys/kern/uipc_domain.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
index bb0be74..7a26ff5 100644
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -149,6 +149,8 @@ net_init_domain(struct domain *dp)
*/
max_hdr = max_linkhdr + max_protohdr;
max_datalen = MHLEN - max_hdr;
+ if (max_datalen < 1)
+ panic("%s: max_datalen < 1", __func__);
}
/*
OpenPOWER on IntegriCloud