Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2017 16:59:33 -0800
From:      Matt Joras <matt.joras@gmail.com>
To:        Farhan Khan <khanzf@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: where ifconfig's socket binds to the interface?
Message-ID:  <CADdTf%2BgAj2_j%2Bk_Ri%2B6ECg2WN8YKfQiiJa%2BfjBJwp23PMZPWZQ@mail.gmail.com>
In-Reply-To: <CAFd4kYB-gZFJHJbpnZ1kLXgQuuWvtOY-XEJMK6eXiifENobdnA@mail.gmail.com>
References:  <CAFd4kYB-gZFJHJbpnZ1kLXgQuuWvtOY-XEJMK6eXiifENobdnA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 3, 2017 at 4:43 PM, Farhan Khan <khanzf@gmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADdTf%2BgAj2_j%2Bk_Ri%2B6ECg2WN8YKfQiiJa%2BfjBJwp23PMZPWZQ>