Bug 157657 - rhpl will always pad single-digit octets in IP address with a 0
rhpl will always pad single-digit octets in IP address with a 0
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: rhpl (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
:
Depends On:
Blocks: 451002
  Show dependency treegraph
 
Reported: 2005-05-13 10:59 EDT by Mihai Ibanescu
Modified: 2008-06-12 06:10 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-26 14:55:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mihai Ibanescu 2005-05-13 10:59:32 EDT
Related to bug 129840

FC4 test3 but goes back to RHEL3 and probably even earlier:

python -c "from rhpl import ethtool; print ethtool.get_ipaddr('lo')"
127.00.00.01

This means we cannot use the output to popuate things like ifcfg-* because of
the padded octet.

up2date uses rhpl.ethtool to extract network interface information, and that
information is put in RHN, and RHN tries to deploy configuration files by doing
macro expansion with info from the database.
Comment 1 Mihai Ibanescu 2005-05-13 11:00:28 EDT
The problem seems to be in ethtool.c line 196

  sprintf(ipaddr, "%02u.%02u.%02u.%02u",
          (unsigned int)ifr.ifr_addr.sa_data[2] % 256,
          (unsigned int)ifr.ifr_addr.sa_data[3] % 256,
          (unsigned int)ifr.ifr_addr.sa_data[4] % 256,
          (unsigned int)ifr.ifr_addr.sa_data[5] % 256);


Is there a reason why it's doing the padding?
Comment 2 Chris Lumens 2005-05-16 11:54:48 EDT
None that I can see.  Fixed in CVS.

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