[PATCHES] multi-channel: implement network interface info ioctl
Stefan Metzmacher
metze at samba.org
Mon Jan 25 09:36:19 UTC 2016
Hi Michael,
> On 2016-01-25 at 09:06 +0100, Stefan Metzmacher wrote:
>>
>> the NDR_PRINT_DEBUG(fsctl_net_iface_info, first); needs to be on
>> a higher debug level.
>
> True, changing this..
>
>> + ret = ioctl(fd, SIOCETHTOOL, &ifr);
>> + if (ret == -1) {
>> + do {
>> + ret = close(fd);
>> + } while (ret == -1 && errno == EINTR);
>> +
>> + return;
>> + }
>> + *speed = (ethtool_cmd_speed(&cmd)) * 1000 * 1000;
>> +}
>>
>> We should already close the fd, not only if ioctl fails!
>
> Oops, true thanks! :-)
>
>> Do we have a sys_close() that already does
>>
>> + do {
>> + ret = close(fd);
>> + } while (ret == -1 && errno == EINTR);
>
> Er no, sys_close() does not exist.
>
>> This hight be an generic problem (or is not needed at at all)
>> @Volker,Jemery: Do we need EINTR on close?
>
> Hmm, just read up on https://lwn.net/Articles/576478/.
> I think I'll go with just close then, for now..
>
> Updated patchset attached, which addresses
> all of the above.
Ok, one more thing, do we want to implement
FSCTL_QUERY_NETWORK_INTERFACE_INFO if
xconn->client->server_multi_channel_enabled
is false?
Otherwise reviewed/signed-off by me.
>> The correct handling for if_index will come later?
>
> Well, I thouhgt about it for a while.
> But I am not sure what the 'correct' handling is.
> What relevance and value would it be for a client
> to know that number instead of a made-up one.
> We do have a patch that gets the if index from the
> kernel. But what about the case of an interface
> that is only specified via the interfaces line?
> In that case we would need to make an index up
> for this interface and make sure not to collide
> with any of those from the kernel.
Just start with 0x80000000 for the ones not comming from the kernel.
In addition to speed and capabilities we can also have a if_index=350
option.
One more question what is the value behind
"Speed: Unknown!" which is reported with "Link detected: no"
I think we should filter out disconnected interfaces in the FSCTL call.
metze
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160125/d397ccfc/signature.sig>
More information about the samba-technical
mailing list