TL-WR1043: switch
Warner Losh
imp at bsdimp.com
Tue Dec 13 15:45:56 UTC 2011
On Dec 13, 2011, at 1:00 AM, Stefan Bethke wrote:
>
> Am 13.12.2011 um 02:41 schrieb Adrian Chadd:
>
>> Hm, it seems your etherswitchcfg code is reusing code from ifconfig?
>> Or is that code from ray?
>>
>> Just a nitpick, we should likely avoid that code duplication and
>> either roll this into ifconfig, or should we just break out the
>> ifconfig related code into a shared library and reuse that?
>
> Ultimately, that would be the correct way. I'd start working on that once it's clear that this is the way forward.
>
> Integrating the switch configuration code into ifconfig has crossed my mind, but I think the overlap is too small to make sense. While the media code manipulates the same data structures (struct ifreq, struct ifmediareq), the ioctls are completely different, so much of the ifconfig infrastructure is actually in the way.
>
> I'm using sbin/ifconfig/if_media.c unchanged except for exporting some of the low level functions for printing and parsing media and mediaopt. I'm not certain where this code would go to be shared efficiently. Also, wherever it goes ifconfig still needs to be buildable for /rescue.
Unless the code is huge, I'd like to see it in ifconfig as well from a usability standpoint. Why require yet another application to do this? We put all the wireless stuff into ifconfig.
If the infrastructure really is getting in the way, I'd like to look at ways to make ifconfig more flexible and less in the way.
Warner
More information about the freebsd-embedded
mailing list