Bug 714732 - ifup calculates wrong broadcast address when using PREFIX with subnetting
Summary: ifup calculates wrong broadcast address when using PREFIX with subnetting
Keywords:
Status: CLOSED DUPLICATE of bug 705367
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.1
Hardware: Unspecified
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-20 14:54 UTC by Ralf Spenneberg
Modified: 2011-06-21 18:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-21 18:47:13 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Ralf Spenneberg 2011-06-20 14:54:06 UTC
Description of problem:


Version-Release number of selected component (if applicable):
initscripts-9.03.23-1.el6.x86_64

How reproducible:
every time

Steps to Reproduce:
1. Define a network device with the following definitions in ifcfg-eth0
PREFIX=29
IPADDR=x.61.58.51
GATEWAY=x.61.58.49
2. Up the device
3. Inspect broadcast address
  
Actual results:
Broadcast x.61.58.255

Expected results:
Broadcast x.61.58.55

Additional info:

Initscripts documentation states that BROADCAST parameter is deprecated. Using this parameter BROADCAST=x.61.58.55 solves the problem.

Comment 2 Bill Nottingham 2011-06-20 19:55:35 UTC

*** This bug has been marked as a duplicate of bug 705367 ***

Comment 3 Ralf Spenneberg 2011-06-21 09:45:59 UTC
I disagree. This is not a duplicate. The netmask is set correctly in my scenario.

I use the following ifcfg-eth0:
DEVICE=eth0
HWADDR=00:26:55:e7:20:ad
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
IPADDR=172.16.128.22
PREFIX=24
GATEWAY=172.16.128.30
USERCTL=no
IPV6INIT=no

This results in the following nic configuration:
# ip a s dev eth0
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:26:55:e7:20:ad brd ff:ff:ff:ff:ff:ff
    inet 172.16.128.22/24 brd 172.16.255.255 scope global eth0

Please note, that the prefix/netmask is set correctly, but the broadcast is calculated for a class b.
The command ifconfig states the same:
eth0      Link encap:Ethernet  Hardware Adresse 00:26:55:E7:20:AD  
          inet Adresse:172.16.128.22  Bcast:172.16.255.255  Maske:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1

The netmask is set correctly to 255.255.255.0 according to the prefix 24. Only the broadcast is set wrong.

Setting BROADCAST=172.16.128.255 corrects the broadcast address. The documenation states that this parameter is deprecated.

Comment 4 Bill Nottingham 2011-06-21 18:47:13 UTC
It's fixed by the same patch, hence why it was marked as a duplicate.

The reason you get the right netmask is because the address is actually added with the prefix instead of the netmask; the internal calculation for the netmask that the scripts use is still wrong.

*** This bug has been marked as a duplicate of bug 705367 ***


Note You need to log in before you can comment on or make changes to this bug.