[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Status of netcfg-static



On Wed, Jan 27, 2010 at 03:39:46PM +0100, Frans Pop wrote:
> On Wednesday 27 January 2010, Josef Wolf wrote:
> > I am wondering what netcfg-static is good for. Looks like it is an
> > (outdated) subset of the more generic netcfg.
> 
> No. It's used for s390:
> installer/build/pkg-lists/netboot/s390.cfg:1:netcfg-static
> installer/build/pkg-lists/generic/s390.cfg:3:netcfg-static

This can not be replaced by the generic netcfg with netcfg/use_dhcp set
to "false" or netcfg/disable_dhcp set to "true"?

And won't generic netcfg fall back to static when dhcp fails? So even the
above settings should not be needed, IMHO.

What is so special about the s390 that it requires/deserves its own netcfg?
Why not introduce netcfg-thinkpad or netcfg-eeepc or something?

Please don't get offended, I'm just asking questions since I don't understand
it.

> > Here is a first attempt to bring those two programs in sync again. There
> > are more differences (especially in the GET_INTERFACE state), but I have
> > not done a closer look at them yet.
> > -    enum { BACKUP, GET_INTERFACE, GET_HOSTNAME_ONLY, GET_STATIC,
> > WCONFIG, WCONFIG_ESSID, WCONFIG_WEP, QUIT} state = GET_INTERFACE; +   
> > enum { BACKUP,
> > +           GET_INTERFACE,
> > +           GET_HOSTNAME_ONLY,
> > +           GET_STATIC,
> > +           WCONFIG,
> > +           WCONFIG_ESSID,
> > +           WCONFIG_WEP,
> > +           QUIT } state = GET_INTERFACE;
> 
> Wireless is useless for s390 (and static network config is almost per 
> definition not suitable for wireless), so the wireless bits should not be 
> synced.

Frans, I have not changed any wireless bits here.

All I have done here was to change whitespace to get the same formatting
of the enum as in the generic netcfg. The wireless stuff is already in
netcfg-static for quite a while. I haven't done any functional changes here
at all. BTW: the wireless bits in netcfg-static are quite different from
the wireless bits in generic netcfg.

IMHO, this proves my point. netcfg-static is a piece of duplicated code for
a very special case. This code tends to be rarely tested and rarely looked
at. When bugs are fixed in the generic netcfg, the fixes are not always
propagated to netcfg-static. This is why I think it would be better to
replace it by the generic netcfg if possible. If this is not possible, at
least the code should be synced as far as possible. A simple "diff -uw"
would then help to check if there are any fixes which have been forgotten
to propagate. Please put a big "IMHO" onto all this writing.

I don't really care about netcfg-static. I don't have a s390 and I don't
know anybody who have one. I just think duplicated code to be a bad thing.

Especially if I see differences like 

           case WCONFIG_WEP:
  -            if (netcfg_wireless_set_wep (client, interface))
  +            if (netcfg_wireless_set_wep(client, interface) == GO_BACK)
                   state = WCONFIG_ESSID;

I get the feeling that there's something wrong. You may argue that wireless
is not used by s390 anyway, but the bad feeling remains.

> > -    while (1) {
> > +    /* Check to see if netcfg should be run at all */
> [...]
> 
> On s390 network configuration is required.

But netcfg/enable is set to "true" by default. So I don't see a functional
change here. Even more: I don't see any reason why netcfg-static could not
be replaced by the generic netcfg.

> >     netcfg.c - Configure a network via DHCP or manual configuration
> > -   for debian-installer
> > +   for the debian-installer
> 
> This is incorrect.

OK, I see. I did not know that netcfg-static is for s390 only and that dhcp
don't work on s390. But my original question remains: are there any reasons
_not_ to replace netcfg-static by generic netcfg?


Reply to: