Red Hat Bugzilla – Bug 193609
Error manually configuring network interface in text-mode install
Last modified: 2007-11-30 17:11:34 EST
Created attachment 130252 [details]
Small python script to illustrate the issue
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: 10.0.0.3
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):
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.
Message box containing error:
You must enter valid IP information to continue
No error, install should proceed to the next screen.
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))
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.
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 @@
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))
Oh sorry, I didn't read carefully enough. Thanks for the patch - we only tested
this on i386. Committing the fix.
*** Bug 193824 has been marked as a duplicate of this bug. ***
Has the patch been applied to the rawhide tree? We are still seeing this
failure on rawhide-20060614 anaconda-22.214.171.124-1 at least on ia64.
Jeremy committed a fix for this today. This code should be dying in the future