From e09d1dbb48ebc335765234f07af13b6c4554d16a Mon Sep 17 00:00:00 2001 From: xtraeme Date: Wed, 30 May 2007 17:03:30 +0000 Subject: [PATCH] Fix for SIOGIFCAP provided by christos, test successful. --- sys/compat/sys/sockio.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/compat/sys/sockio.h b/sys/compat/sys/sockio.h index 7a6408004b33..b56176935f7d 100644 --- a/sys/compat/sys/sockio.h +++ b/sys/compat/sys/sockio.h @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.1 2007/05/29 21:32:28 christos Exp $ */ +/* $NetBSD: sockio.h,v 1.2 2007/05/30 17:03:30 xtraeme Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -100,11 +100,12 @@ struct oifconf { /* * XXX: The following macro depends on the fact that the only struct - * sized 0x20 bytes in the ifioctls is struct oifreq. If that changes, - * then we'll need to use an explicit list here. + * sized 0x20 bytes in the ifioctls is struct oifreq and struct ifcapreq. + * If that changes, then we'll need to use an explicit list here. */ +#define ifcapreq(x) ((x) == SIOCGIFCAP || (x) == SIOCSIFCAP) #define cvtcmd(x) \ - ((IOCPARM_LEN(x) == sizeof(struct oifreq)) ? \ + ((IOCPARM_LEN(x) == sizeof(struct oifreq) && !ifcapreq(x)) ? \ (((x) & ~(IOCPARM_MASK << IOCPARM_SHIFT)) | \ (sizeof(struct ifreq) << IOCPARM_SHIFT)) : (x))