# Bug or operator error?  Problems with broadcast_eth0

## sgmattk

Howdy,

I'm tearing my hair out.  My /etc/conf.d/net file is as follows:

 *Quote:*   

> 
> 
> # Copyright 1999-2002 Gentoo Technologies, Inc.
> 
> # Distributed under the terms of the GNU General Public License, v2 or later
> ...

 

The resulting ifconfig looks like this:

 *Quote:*   

> 
> 
> eth0      Link encap:Ethernet  HWaddr 00:E0:3F:04:55:C3
> 
>           inet addr:x.x.x.194  Bcast:x.x.x.207  Mask:255.255.255.240
> ...

 

Note the very weird entry for eth0:0.  

Yes, I did put all those x's in all the addresses on purpose.

In case you're wondering, putting the addresses on their own lines instead of just using spaces doesn't make a difference -- I've tried it both ways.  It's just easier to read this way.

Also, if I comment out the broadcast_eth0 and netmask_eth0 lines I get broadcasts of x.x.x.255 and netmasks of x.x.x.0 for everything except for eth0:0, which comes up with the proper x.x.x.207 and x.x.x.240 -- another weirdness.

I've tried a lot of combinations.  Is there something I'm doing wrong or is there a bug in the net startup script?  (I'm looking through that next)

Thanks in advance.

----------

## pilla

I tried to do simulate your problem and had similar symptons.... aditionally, I had problems to shut down the network plus some SIO.... errors.

It seems that something is wrong there --- the scripts or the sintax to write the configuration file...

----------

## Naan Yaar

It is seemingly a bug in /etc/init.d/net.eth0.  Lines that say something like:

```

aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk

\'\{ print \$${num} \}\')"

...

aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'

\{ print \$${num} \}\')"

```

should actually be:

```

aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk

\'\{ print \$$((num+1)) \}\')"

...

aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'

\{ print \$$((num+1)) \}\')"

```

Note: for a single alias the code in net.eth0 will work OK.  It breaks when there are multiple aliases, as you do.Last edited by Naan Yaar on Tue Sep 17, 2002 8:26 pm; edited 1 time in total

----------

## pilla

Thus, I think you should submit a bug report.

----------

## Naan Yaar

Reported to bugs.gentoo.org.  Follow url for more details.

----------

