summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2008-10-18 12:30:41 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2008-10-18 12:30:41 +0000
commitda565113f33e992accd642b5a6f64ed656a4e8ab (patch)
tree48bdb99cd94834faeecd22f7d2270beca85d4e77 /sys/net
parentc7991f8c4692b41c6d26fddd7676282d1d0597df (diff)
Prevent the user to assign reserved labels to mpe(4) interfaces.
OK claudio@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_mpe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c
index 892f20cdb1f..518220355d2 100644
--- a/sys/net/if_mpe.c
+++ b/sys/net/if_mpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mpe.c,v 1.10 2008/10/14 20:43:33 michele Exp $ */
+/* $OpenBSD: if_mpe.c,v 1.11 2008/10/18 12:30:40 michele Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -247,7 +247,8 @@ mpeioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
ifm = ifp->if_softc;
if ((error = copyin(ifr->ifr_data, &shim, sizeof(shim))))
break;
- if (shim.shim_label > MPLS_LABEL_MAX) {
+ if (shim.shim_label > MPLS_LABEL_MAX ||
+ shim.shim_label <= MPLS_LABEL_RESERVED_MAX) {
error = EINVAL;
break;
}