TL-WR1043: switch

Stefan Bethke stb at lassitu.de
Tue Dec 13 08:00:52 UTC 2011


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.


Stefan

-- 
Stefan Bethke <stb at lassitu.de>   Fon +49 151 14070811





More information about the freebsd-embedded mailing list