Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157657 - rhpl will always pad single-digit octets in IP address with a 0
Summary: rhpl will always pad single-digit octets in IP address with a 0
Alias: None
Product: Fedora
Classification: Fedora
Component: rhpl
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Chris Lumens
QA Contact:
Depends On:
Blocks: 451002
TreeView+ depends on / blocked
Reported: 2005-05-13 14:59 UTC by Mihai Ibanescu
Modified: 2008-06-12 10:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-05-26 18:55:35 UTC

Attachments (Terms of Use)

Description Mihai Ibanescu 2005-05-13 14:59:32 UTC
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')"

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 15:00:28 UTC
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 15:54:48 UTC
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.