From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 09:47:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DEAC106566C; Tue, 27 Apr 2010 09:47:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E2518FC1E; Tue, 27 Apr 2010 09:47:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3R9lEuM069504; Tue, 27 Apr 2010 09:47:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R9lEUt069503; Tue, 27 Apr 2010 09:47:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004270947.o3R9lEUt069503@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Apr 2010 09:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207268 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 09:47:15 -0000 Author: kib Date: Tue Apr 27 09:47:14 2010 New Revision: 207268 URL: http://svn.freebsd.org/changeset/base/207268 Log: Provide 32bit compat for SIOCGDEFIFACE_IN6. Based on submission by: pluknet gmail com Reviewed by: emaste MFC after: 2 weeks Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Apr 27 07:34:20 2010 (r207267) +++ head/sys/netinet6/in6.c Tue Apr 27 09:47:14 2010 (r207268) @@ -63,6 +63,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -176,6 +177,14 @@ in6_mask2len(struct in6_addr *mask, u_ch #define ifa2ia6(ifa) ((struct in6_ifaddr *)(ifa)) #define ia62ifa(ia6) (&((ia6)->ia_ifa)) +#ifdef COMPAT_FREEBSD32 +struct in6_ndifreq32 { + char ifname[IFNAMSIZ]; + uint32_t ifindex; +}; +#define SIOCGDEFIFACE32_IN6 _IOWR('i', 86, struct in6_ndifreq32) +#endif + int in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) @@ -226,6 +235,22 @@ in6_control(struct socket *so, u_long cm case SIOCGNBRINFO_IN6: case SIOCGDEFIFACE_IN6: return (nd6_ioctl(cmd, data, ifp)); + +#ifdef COMPAT_FREEBSD32 + case SIOCGDEFIFACE32_IN6: + { + struct in6_ndifreq ndif; + struct in6_ndifreq32 *ndif32; + + error = nd6_ioctl(SIOCGDEFIFACE_IN6, (caddr_t)&ndif, + ifp); + if (error) + return (error); + ndif32 = (struct in6_ndifreq32 *)data; + ndif32->ifindex = ndif.ifindex; + return (0); + } +#endif } switch (cmd) {