Paulo Stein wrote:
> Hi,
> 
> I pretty new to rtnet, so forgive me any nonsense.

No nonsense, valuable feedback in fact!

>>> Index: stack/socket.c
>>> ===================================================================
>>> --- stack/socket.c    (revision 1087)
>>> +++ stack/socket.c    (working copy)
>>> @@ -229,7 +229,7 @@
>>>     struct ifreq        *ifr = arg;
>>>     int                 ret = 0;
>>>
>>>     if (request == SIOCGIFCONF) {
>>>         struct ifconf       *ifc = arg;
>>>         struct ifreq        *cur_ifr = ifc->ifc_req;
>>> @@ -279,6 +279,10 @@
>>>         case SIOCGIFFLAGS:
>>>             ifr->ifr_flags = rtdev->flags;
>>>             break;
>>> +            +        case SIOCETHTOOL:
>>> +            ret = rtdev->do_ioctl( rtdev, request, arg);
>>> +            break;
>>>
>>>         default:
>>>             ret = -EOPNOTSUPP;
>>>   
> 
> I guess that are some that don't have do_ioctl defined. This must be
> 
> +            if (rtdev->do_ioctl) {
> +                    ret = rtdev->do_ioctl( rtdev, request, arg);
> +            }

Correct. Jorge's first patch had this test; must have been lost during
rewrite.

> 
> I think that a more generic approach would be, instead of inserting
> another option in  stack/socket.c, to do something like this:
> 
> ----------------------------
> diff -r -c rtnet.orig/stack/socket.c rtnet.new/stack/socket.c

diff -up, please.

> *** rtnet.orig/stack/socket.c   2006-11-29 15:01:01.000000000 -0200
> --- rtnet.new/stack/socket.c    2006-11-29 15:39:43.000000000 -0200
> ***************
> *** 281,287 ****
>              break;
> 
>          default:
> !             ret = -EOPNOTSUPP;
>              break;
>      }
> 
> --- 281,291 ----
>              break;
> 
>          default:
> !             if (rtdev->do_ioctl) {
> !                 ret = rtdev->do_ioctl(rtdev, request, arg);
> !             } else {
> !                 ret = -EOPNOTSUPP;
> !             }
>              break;
>      }

That's valid refactoring for now, but will likely get reverted later
again when we push things like generic ethertool argument handling into
a common code block. I would prefer to keep it explicitly, maybe already
with a "TODO:" comment.

Thanks for having a look. Just proven again: the more eyes, the better!

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
RTnet-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-developers

Reply via email to