Bug 193609 - Error manually configuring network interface in text-mode install
Error manually configuring network interface in text-mode install
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Anaconda Maintenance Team
Mike McLean
: 193824 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2006-05-30 23:41 EDT by Chris Tracy
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-06-15 16:24:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Small python script to illustrate the issue (306 bytes, text/plain)
2006-05-30 23:41 EDT, Chris Tracy
no flags Details

  None (edit)
Description Chris Tracy 2006-05-30 23:41:42 EDT
Created attachment 130252 [details]
Small python script to illustrate the issue
Comment 1 Chris Tracy 2006-05-30 23:41:42 EDT
Description of problem:
Trying to install rawhide on an opteron system.  (Sun Ultra 20)  Doing a
network-install via PXE and FTP.

I uncheck "Configure using DHCP" and leave "Activate on boot" selected.
Fill out the IP address and netmask fields with valid info (the same info the
box is currently using inside anaconda, actually):

IP Address:

Click "OK" and I get a message box saying:

"You must enter valid IP information to continue"

If I recheck "Configure using DHCP" it works fine.  If I uncheck "Activate
on boot" I can proceed, but I do want this interface activated on boot.  :-)

Version-Release number of selected component (if applicable):
anaconda- (x86_64)

How reproducible:
Happens to me on this system every time.  Don't have another available to test.

Steps to Reproduce:
1.  PXE boot the rawhide kernel image/initrd.
2.  Use text mode install.  (Happened automatically here, a regression that I've
not tracked down yet)
3.  Uncheck "Configure using DHCP" when prompted, supply valid IP and netmask.
Actual results:
Message box containing error:
You must enter valid IP information to continue

Expected results:
No error, install should proceed to the next screen.

Additional info:

Dropping to the debugger in anaconda, I see that in textw/network_text.py:171
there's a call to isys.inet_calcNetBroad which leads to isys/isys.py:417
a call to inet_aton, which in turn is at isys.py:393.

The kicker here is the line:

return struct.unpack('L', socket.inet_aton(addr))[0]

single stepping through with the debugger, the call to
"struct.unpack" is failing with the error:

struct.error: unpack str size does not match format

I created a small test program that basically does the same thing as inet_aton()
here.  On my i686 FC3 box (python-2.3.4) it works fine.  On a CentOS 4.3 x86_64
box I have access to (python-2.3.4) it fails with the same "struct.error: ..."

(I've attached the program to this bug)

Linux defines "struct in_addr" to contain one field, "__u32 saddr", an explicit
32-bit unsigned int.  So changing the struct.unpack() format string from
'L' to 'I' would seem to be the right thing to do.  And indeed, my test program
works correctly on both i686 and x86_64 when done that way.

I've not rebuilt anaconda and tried to test the patch there, however, and I'm
largely out of my depth here, so I could be all wrong.  Hopefully this is at
least somewhat helpful, however.
Comment 2 Chris Lumens 2006-05-31 10:06:58 EDT
Yep, we noticed this after FC5 went out as well.  It has been fixed in anaconda.
 Here's the appropriate patch:

RCS file: /usr/local/CVS/anaconda/isys/isys.py,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- isys.py     30 Mar 2006 18:06:41 -0000      1.165
+++ isys.py     26 Apr 2006 15:49:47 -0000      1.166
@@ -27,6 +27,7 @@
 import warnings
 import resource
 import rhpl
+import struct
 import logging
 log = logging.getLogger("anaconda")
@@ -387,11 +388,11 @@
 # XXX: Use socket.getnameinfo for ipv6 compatibility
 def inet_ntoa (addr):
-    return socket.inet_ntoa(addr)
+    return socket.inet_ntoa(struct.pack('l', addr))
 def inet_aton (addr):
-        return socket.inet_aton(addr)
+        return struct.unpack('L', socket.inet_aton(addr))[0]
         raise ValueError
Comment 3 Chris Lumens 2006-05-31 11:29:33 EDT
Oh sorry, I didn't read carefully enough.  Thanks for the patch - we only tested
this on i386.  Committing the fix.
Comment 4 Chris Lumens 2006-06-01 17:12:55 EDT
*** Bug 193824 has been marked as a duplicate of this bug. ***
Comment 5 Doug Chapman 2006-06-14 11:03:03 EDT
Has the patch been applied to the rawhide tree?  We are still seeing this
failure on rawhide-20060614 anaconda- at least on ia64.
Comment 6 Chris Lumens 2006-06-15 16:24:02 EDT
Jeremy committed a fix for this today.  This code should be dying in the future

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