From 9bee2cd7f153f3c94c3828d72228f8a2461c68f5 Mon Sep 17 00:00:00 2001 From: dyoung Date: Sat, 1 Sep 2007 07:03:32 +0000 Subject: [PATCH] Fix compilation if !defined(INET6). Thanks, Geoff Wing, for the bug report & patch. --- sys/net/if.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 4daf158c422f..981948574f0a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.198 2007/08/31 21:02:15 dyoung Exp $ */ +/* $NetBSD: if.c,v 1.199 2007/09/01 07:03:32 dyoung Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.198 2007/08/31 21:02:15 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.199 2007/09/01 07:03:32 dyoung Exp $"); #include "opt_inet.h" @@ -1676,9 +1676,12 @@ ifreq_setaddr(const u_long cmd, struct ifreq *ifr, const struct sockaddr *sa) const uint8_t osockspace = sizeof(ifr->ifr_addr); const uint8_t sockspace = sizeof(ifr->ifr_ifru.ifru_space); +#ifdef INET6 if (cmd == SIOCGIFPSRCADDR_IN6 || cmd == SIOCGIFPDSTADDR_IN6) len = MIN(sizeof(struct sockaddr_in6), sa->sa_len); - else if ((ncmd = compat_cvtcmd(cmd)) != cmd) + else +#endif /* INET6 */ + if ((ncmd = compat_cvtcmd(cmd)) != cmd) len = MIN(sockspace, sa->sa_len); else len = MIN(osockspace, sa->sa_len);