where ifconfig's socket binds to the interface?

Matt Joras matt.joras at gmail.com
Mon Dec 4 00:59:36 UTC 2017


On Sun, Dec 3, 2017 at 4:43 PM, Farhan Khan <khanzf at 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


More information about the freebsd-hackers mailing list