From owner-freebsd-hackers@freebsd.org Mon Dec 4 00:43:28 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 29375E6E65D for ; Mon, 4 Dec 2017 00:43:28 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-yb0-x22c.google.com (mail-yb0-x22c.google.com [IPv6:2607:f8b0:4002:c09::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 DC63370E9F for ; Mon, 4 Dec 2017 00:43:27 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-yb0-x22c.google.com with SMTP id b73so2526692yba.6 for ; Sun, 03 Dec 2017 16:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=R6eNZ0TJzy0/BnpWkXEBnYbGk+GyTY5BBshcGIQxnJU=; b=RyPvs29bg25Fex8tmiEiGfRGKf/09IUeNM9T1jlx4kaBU/11wnbb/4HZr2aD32Fikx qXvd0EE+ZIrobLT2kR08SJLpKqXT7kg31K8KDq9LTaw8gbiNt6rr8oXeZDFz68u5CWXI cPRqJAMiqlDlRo4HDquOa+TXDqF2b82UmF04TYft57GjXx9k99LaDLSbNWq40xXMRONc M4/C62hczhEhVrOPZt64CohQms9o36ttRXVFK++MUeVok6Gl8zpdf7T7yK0AMvx1j4T3 TNWkU1pK6SoNHWA87C1+okG2yxhYdBfGwcT5PdvAYy+Pl1UGonHy/DjpHJAc+DPrtcue dYhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=R6eNZ0TJzy0/BnpWkXEBnYbGk+GyTY5BBshcGIQxnJU=; b=T0xFGAClMpWSbSt5fqnbN1mXR708HvBwngkJ/ahEvseoHFOcdTMCtExxrI8GRRKDgy ANJNFAo9sGiPSwgTCM2DunfuDWCBD6ZaFnBiAsEvuMvnoUvwZB4KObqtD8KpVtRXdWpV ggSKzXacbxPSJ7g4ADEpQkuGxedzFXsONK24P1TpCRXboUHoMftZKORJLgod+pakPO3h SI1ehSc4Mk1w9WhfXBItCdfDRQDHR92bMBpcewSbRpA6eJd4H0qJbK/RD7fm4UNg9hDr 7lwc7LBkbm5e7WTpByNPhhqiYN9uhgCOVuPy46s2JVfY7kFVHEV2azeoNP78QcwXr0ju d9JQ== X-Gm-Message-State: AJaThX6+NWEUug2T/LXEqnwgsNNmDIy11A1qn+7IFZO4rlflZd6tcFL+ cD6RPg2e5vMMHv+WpaUwmhw31HZ+yBd9IP5m2mnOig== X-Google-Smtp-Source: AGs4zMbclVk1xIO1VFsHJl5D72eQYL1KmaKAoAYobWQuFiKnnhjHAdbE5mQc363fErN8e/oehy0wXtaJksn5cDABLb0= X-Received: by 10.37.20.193 with SMTP id 184mr8121127ybu.400.1512348206823; Sun, 03 Dec 2017 16:43:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.186.147 with HTTP; Sun, 3 Dec 2017 16:43:06 -0800 (PST) From: Farhan Khan Date: Sun, 3 Dec 2017 19:43:06 -0500 Message-ID: Subject: where ifconfig's socket binds to the interface? To: 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 00:43:28 -0000 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