From owner-freebsd-net@FreeBSD.ORG Mon Mar 30 13:49:56 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDBAC240 for ; Mon, 30 Mar 2015 13:49:56 +0000 (UTC) Received: from mail-pd0-x22c.google.com (mail-pd0-x22c.google.com [IPv6:2607:f8b0:400e:c02::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2C72E5 for ; Mon, 30 Mar 2015 13:49:56 +0000 (UTC) Received: by pddn5 with SMTP id n5so60278601pdd.2 for ; Mon, 30 Mar 2015 06:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=iyrjjFelvBDkcld16fLzYhzMEwOpB71hkGAySuBbmLE=; b=Q4kFdmbxYU3fQbLKssDLBs/JLwZRulMeJVLsZfm74BD83hKxNR/f3PQ9lzonVQWv1a K505QApZg3wpLaR9+ZrAnoDfyVp+6e4OYr4bv/6KYEyvz6hdYdnTnUCc2OuCDMFsxpYM JZUCSRaU1NgyiyNPOsnISph30UMBBhyHtZLw2kqOMbVwVvSCVQabZ6sJvy3i0SHJbMjL 8ME77LgUDv5A0l4X4IgbKdQHI5Wpk/8rtReJqi6Fq2IW7837HOlTX+K7Kep2Ja8Dgj86 yaW/KJlaXBaz4ZE3qPeXUyPkDcf1rAJutbI+EFHkDjx8RzdCYhrqh4kbFhdmUt5GS2H3 B2PQ== MIME-Version: 1.0 X-Received: by 10.70.41.202 with SMTP id h10mr12401248pdl.84.1427723396159; Mon, 30 Mar 2015 06:49:56 -0700 (PDT) Received: by 10.66.83.137 with HTTP; Mon, 30 Mar 2015 06:49:56 -0700 (PDT) Date: Mon, 30 Mar 2015 09:49:56 -0400 Message-ID: Subject: Programmatically Creating VLAN in the Kernel From: Juan Mojica To: FreeBSD Net Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2015 13:49:56 -0000 I'm trying to programmatically create a VLAN in the kernel via ifioctl, but I'm hitting a "copyin" in the ioctl path, and since the address I'm passing in is a kernel address and not a user space address, the copyin is failing. Calling the ioctl from user space is a non-starter at this point, and I believe there will be other ioctls that will have to be called from the kernel which will hit the same issue. Any suggestions? So far I've thought about marking the ifreq flags to indicate the request came from the kernel and essentially bypass the copyin. Another option would be to make the create functions globally available, but this would violate the modularity of the VLAN module. Thanks in advance, -- Juan Mojica Email: jmojica@gmail.com