From a6c57fe6a9788e1153c281f016d466b04726484b Mon Sep 17 00:00:00 2001 From: bms Date: Fri, 2 Feb 2007 22:27:45 +0000 Subject: Use int instead of u_int for the 'extra' argument to the clone_create() KPI. This fixes a signedness bug in unit number comparisons. Submitted by: imp, Landon Fuller PR: kern/105228 MFC after: 2 weeks --- sys/kern/kern_conf.c | 2 +- sys/net/if_tap.c | 2 +- sys/sys/conf.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 5520da8..177b66b 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -803,7 +803,7 @@ clone_setup(struct clonedevs **cdp) } int -clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, u_int extra) +clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, int extra) { struct clonedevs *cd; struct cdev *dev, *ndev, *dl, *de; diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index ddb14cd..1b51647 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -255,7 +255,7 @@ tapmodevent(module_t mod, int type, void *data) static void tapclone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev) { - u_int extra; + int extra; int i, unit; char *device_name = name; diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 4f679fb..7380381 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -240,7 +240,7 @@ void clone_setup(struct clonedevs **cdp); void clone_cleanup(struct clonedevs **); #define CLONE_UNITMASK 0xfffff #define CLONE_FLAG0 (CLONE_UNITMASK + 1) -int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, u_int extra); +int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, int extra); int count_dev(struct cdev *_dev); void destroy_dev(struct cdev *_dev); -- cgit v1.1