From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Tilman Schmidt <tilman@imap.cc>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH] netdevice.7: document SIOCGIFCONF case ifc_req==NULL
Date: Thu, 16 Jan 2014 17:23:58 +1300 [thread overview]
Message-ID: <52D75EDE.4020404@gmail.com> (raw)
In-Reply-To: <52D04B8B.3040306@imap.cc>
On 01/11/2014 08:35 AM, Tilman Schmidt wrote:
> Hello Michael,
>
> Am 10.01.2014 18:52, schrieb Michael Kerrisk (man-pages):
>> On 01/10/2014 12:30 PM, Tilman Schmidt wrote:
>>> Add the missing description of the possibility to call SIOCGIFCONF
>>> with ifc_req==NULL to determine the needed buffer size, as described
>>> in http://lkml.indiana.edu/hypermail/linux/kernel/0110.1/0506.html
>>> and verified against source files net/core/dev_ioctl.c and
>>> net/ipv4/devinet.c in the current kernel git tree.
> [...]>
>> Thanks for the patch. I'm trying to verify this from the code, but
>> am having some trouble finding the relevant pieces. Could you point
>> me more specifically at the points in the kernel source where this
>> case is handled?
>
> Gladly.
>
> Function dev_ifconf() [net/core/dev_ioctl.c line 67ff.] is the main
> handler for SIOCGIFCONF. It calls the registered protocol specific
> handlers via the table gifconf_list[]. The current kernel has only
> one such handler, inet_gifconf() [net/ipv4/devinet.c line 1115ff.]
>
> If ifc.ifc_buf is NULL, dev_ifconf() calls the protocol specific
> handlers with NULL as second argument. [net/core/dev_ioctl.c line 96]
>
> If inet_gifconf() is called with NULL as second argument it just
> adds up the data sizes, skipping the size check and data transfer.
> [net/ipv4/devinet.c line 1127f.]
Thanks. Patch applied.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
prev parent reply other threads:[~2014-01-17 4:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 23:30 [PATCH] netdevice.7: document SIOCGIFCONF case ifc_req==NULL Tilman Schmidt
[not found] ` <20140109233018.886FA140064-MSQiN3VOO+MkAF8ESQKhnNBPR1lH4CV8@public.gmane.org>
2014-01-10 17:52 ` Michael Kerrisk (man-pages)
[not found] ` <52D03351.20501-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-10 19:35 ` Tilman Schmidt
2014-01-16 4:23 ` Michael Kerrisk (man-pages) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52D75EDE.4020404@gmail.com \
--to=mtk.manpages@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tilman@imap.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).