From owner-freebsd-hackers@freebsd.org Mon Dec 4 02:45:45 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEB1EDBAD20 for ; Mon, 4 Dec 2017 02:45:45 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) (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 7A14374CB7 for ; Mon, 4 Dec 2017 02:45:45 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-yw0-x243.google.com with SMTP id w128so6157420ywa.1 for ; Sun, 03 Dec 2017 18:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=yf1Myj4/D9mofwQX733M4HyY89u6IhfyxxbpJeB/26k=; b=UV+8glI2JI6h4lRUqjfyoZRIPX4uXSnVRT2Ok/xJvi94TAEWJYJeYRWrHk+MZMMsI7 YtCI3fNnPkcqXfoC80wkooBoHAFuKNSH+xW45bhZgaDQQOu5uOePQGzeZKltyKe8U2mr CvFi1cR7c4Ezc++8YwZIn85NzxtRHJoI7yh0l4mvyOuxuUk+jl7mjsklB8uvTU9SI/gF NSvuAtfEBileNmRBeMakTJXlyetpRBjXWKce4CLrCRlnI4DxWyxRDAZQAqXb5ja8H0vj 5qvYrJsDxCwJdggoauZJFCfvEP0oLlXEGg4U9CIVUt7292lFUgm0uEQhNMMwo58qof2t 8B4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=yf1Myj4/D9mofwQX733M4HyY89u6IhfyxxbpJeB/26k=; b=AcLz8olE9jqpyV36fUCw/yhGS1HHmE0hkemBoYzrFCbY65q6TErFQ6pbxGwSzjM9hb 1Ymj1CTrNDZnZW5fR+RTQ/7+iluMAGDUakWXEEcej2Na2f9bQbAKwUooy9Xzl73HseQ/ ZhsDIGe+oTwmm02mOZ7jE0nedX/DVrerPZ2/ZdL/jCnS4m5mZteH7TBDad4g9ZUXgU51 NUr7GhRsdZ5FJC0AAB6oBfwuu2UVsl2Ej1da8YMCWT2XxNhXL1s/k7WoX55m6N62hhub lqWq1kY01Zu8slHll225/KNh+znjuYNyrXXle2wgE4ApKlanM9w6MU+U61+UpX9Cd2V0 gFLw== X-Gm-Message-State: AJaThX5/ngQ60Z+VsqC4h/72gV1t7q1nMUk+H2GGnVk0DCP7cO9P0pkE pFOuSvTDBlWH+Tbn9+ZjsW6rPnH+5pjRk9mL/T4PRg== X-Google-Smtp-Source: AGs4zMbynM9iJ+aVFDFT8Wz1BpA/v5XIrQXQ2EmisGd2IPc0uu3lv1/boHy5VsF0b9MGJIfkRSU4WIgGU3mkEG8LYcs= X-Received: by 10.129.90.65 with SMTP id o62mr9136725ywb.462.1512355544361; Sun, 03 Dec 2017 18:45:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.186.147 with HTTP; Sun, 3 Dec 2017 18:45:24 -0800 (PST) In-Reply-To: References: From: Farhan Khan Date: Sun, 3 Dec 2017 21:45:24 -0500 Message-ID: Subject: Re: where ifconfig's socket binds to the interface? Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2017 02:45:45 -0000 I reviewed this about 6 months ago and had forgotten it took place there as an ioctl(2) argument. Thank you for reminding me! -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE On Sun, Dec 3, 2017 at 7:59 PM, Matt Joras wrote: > On Sun, Dec 3, 2017 at 4:43 PM, Farhan Khan wrote: > > Hi all, > > > > Does anyone know where in ifconfig(8)'s source it opens a socket and > > connects that to the specified interface? I see the socket(2) call in > > /usr/src/sbin/ifconfig/ifconfig.c. The while-loop at 767 seems to > iterate > > through each command. But I can't seem to locate where it connects that > > socket(2) to the provided interface. > > > > Any ideas? > > Thanks! > > > > -- > > Farhan Khan > > PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE > There is no notion of "connecting" to an interface with the socket > opened by ifconfig(8). The socket in question is used as the parameter > to the various ioctl(2) calls. See e.g. the setifmtu function for an > example usage. > > Matt Joras >