[sudo-workers] Is there a way to avoid get_net_ifs() when the information won't be used?
Rick Jones
rick.jones2 at hp.com
Thu Jan 23 14:15:36 MST 2014
On 01/23/2014 11:37 AM, Todd C. Miller wrote:
> On Thu, 23 Jan 2014 10:58:20 -0800, Rick Jones wrote:
>
>> A run-time switch would be splendid.
>
> I'll implement that in the next sudo release.
I would be happy to be a pre-release guinea pig for that.
>> I've gone ahead and fired-up a FreeBSD 9.2-RELEASE VM, and created 8000
>> "gre" interfaces (without IPs assigned, just "ifconfig greN create")and
>> while there was a slight increase in time for sudo (unpatched 1.8.9p4)
>> of a few milliseconds, it wasn't nearly as bad as under Linux. I'm
>> going to spin-up a similar, Ubuntu 13.10 VM to get a better A/B
>> comparison (everything I've mentioned thusfar has been bare-iron, but I
>> don't have the luxury of running FreeBSD on bare-iron) and perhaps
>> mention it to the Linux netdev folks. Would you like to be cc'd on that
>> message?
>
> The first __sysctl() is probably to get the size and the other is
> to fill it in. I think it is worth mentioning to Linux net-dev.
I've sent a missive to netdev - didn't cc you on it, but it should
appear in the archives before long
http://vger.kernel.org/vger-lists.html#netdev . The subject is
"getifaddrs performance, sudo and Linux vs FreeBSD."
I was thinking the same thing about the sysctl - the pity is that truss
doesn't seem to know how to further decode the system call. However,
assuming
https://github.com/freebsd/freebsd-head/blob/master/lib/libc/net/getifaddrs.c
matches what I'm using in the FreeBSD VM then indeed, it is two calls -
one to get the quantity of space needed, and then one to fetch it.
rick
> It may be possible to use recvmsg() with a scatter-gather buffer
> instead of repeated calls.
>
> - todd
>
More information about the sudo-workers
mailing list