Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 301618 Details for
Bug 435978
Rescue mode networking fails to start
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
0001-Make-isys.dhcpNetDevice-work-in-rescue-mode-4359.patch
0001-Make-isys.dhcpNetDevice-work-in-rescue-mode-4359.patch (text/plain), 9.40 KB, created by
David Cantrell
on 2008-04-08 10:26:09 UTC
(
hide
)
Description:
0001-Make-isys.dhcpNetDevice-work-in-rescue-mode-4359.patch
Filename:
MIME Type:
Creator:
David Cantrell
Created:
2008-04-08 10:26:09 UTC
Size:
9.40 KB
patch
obsolete
>From ea648b05d102ef69c2fc3883bcdaaffabf2d10f9 Mon Sep 17 00:00:00 2001 >From: David Cantrell <dcantrell@redhat.com> >Date: Tue, 8 Apr 2008 00:21:54 -1000 >Subject: [PATCH] Make isys.dhcpNetDevice() work in rescue mode (#435978). > >Remove the isys.pumpNetDevice() function since it's just a >passthrough for dhcpNetDevice() at this point. Update the >function in isys.c to take in None for the class name. Fix >the anyUsingDHCP() function in network.py for rescue mode >and update calls as appropriate. Update rescue.py to call >dhcpNetDevice() instead of pumpNetDevice(). And update the >list of files for the rescue image to include /sbin/dhclient >and /sbin/dhcp6c and fallbacks for users. >--- > isys/isys.c | 15 +++++++++++---- > isys/isys.py | 11 ++--------- > iw/network_gui.py | 21 +++++---------------- > network.py | 17 ++++++++++------- > rescue.py | 2 +- > scripts/upd-instroot | 5 ++++- > textw/network_text.py | 11 ++++++++--- > 7 files changed, 41 insertions(+), 41 deletions(-) > >diff --git a/isys/isys.c b/isys/isys.c >index d27425a..fcec6fd 100644 >--- a/isys/isys.c >+++ b/isys/isys.c >@@ -618,18 +618,23 @@ static PyObject * doDhcpNetDevice(PyObject * s, PyObject * args) { > char * device = NULL; > char * class = NULL; > char * r = NULL; >- char buf[47]; >+ char buf[48]; > time_t timeout = 45; > struct pumpNetIntf *pumpdev = NULL; > /* FIXME: we call this from rescue mode, need to pass in what user wants */ > DHCP_Preference pref = DHCPv6_DISABLE_RESOLVER|DHCPv4_DISABLE_HOSTNAME_SET; >- int status, shmpump, i; >+ int status, shmpump = -1, i; > pid_t pid; > key_t key; > ip_addr_t *tip; > PyObject * rc; > >- if (!PyArg_ParseTuple(args, "s|s", &device, &class)) >+ /* XXX: known bug with libdhcp+libdhcp6client, disabling for now as a >+ * workaround (problem started in BZ #435978) >+ */ >+ pref |= DHCPv6_DISABLE; >+ >+ if (!PyArg_ParseTuple(args, "s|z", &device, &class)) > return NULL; > > if (class == NULL) >@@ -646,12 +651,14 @@ static PyObject * doDhcpNetDevice(PyObject * s, PyObject * args) { > return Py_None; > } > >- pumpdev = (struct pumpNetIntf *) shmat(shmpump, (void *) pumpdev, SHM_RND); >+ pumpdev = (struct pumpNetIntf *) shmat(shmpump, (void *) pumpdev, >+ SHM_RND); > if (((void *) pumpdev) == ((void *) -1)) { > Py_INCREF(Py_None); > return Py_None; > } > >+ memset(pumpdev->device, '\0', IF_NAMESIZE); > strncpy(pumpdev->device, device, IF_NAMESIZE); > > /* call libdhcp in a separate process because libdhcp is bad */ >diff --git a/isys/isys.py b/isys/isys.py >index fceb5e6..c8ac04c 100644 >--- a/isys/isys.py >+++ b/isys/isys.py >@@ -543,17 +543,10 @@ def resetResolv(): > def setResolvRetry(count): > return _isys.setresretry(count) > >-def dhcpNetDevice(device, klass = None): >+def dhcpNetDevice(device, dhcpclass=None): > # returns None on failure, "" if no nameserver is found, nameserver IP > # otherwise >- if klass is not None: >- return _isys.dhcpnetdevice(device, klass) >- else: >- return _isys.dhcpnetdevice(device) >- >-def pumpNetDevice(device, klass = None): >- return dhcpNetDevice(device, klass) >- >+ return _isys.dhcpnetdevice(device, dhcpclass) > > def readXFSLabel_int(device): > try: >diff --git a/iw/network_gui.py b/iw/network_gui.py >index 1aaeff3..7bc586f 100644 >--- a/iw/network_gui.py >+++ b/iw/network_gui.py >@@ -62,7 +62,7 @@ class NetworkWindow(InstallWindow): > # boxes. Otherwise, don't clear the values out if we are doing > # kickstart since we could be in interactive mode. Don't want to > # write out a broken resolv.conf later on, after all. >- if not self.anyUsingDHCP(): >+ if not network.anyUsingDHCP(self.devices, anaconda): > tmpvals = {} > for t in range(len(global_options)): > try: >@@ -117,7 +117,7 @@ class NetworkWindow(InstallWindow): > > def setHostOptionsSensitivity(self): > # figure out if they have overridden using dhcp for hostname >- if self.anyUsingDHCP(): >+ if network.anyUsingDHCP(self.devices, anaconda): > self.hostnameUseDHCP.set_sensitive(1) > > if self.hostname != "localhost.localdomain" and self.network.overrideDHCPhostname: >@@ -134,7 +134,7 @@ class NetworkWindow(InstallWindow): > if numactive == 0: > state = False > else: >- state = not self.anyUsingDHCP() >+ state = not network.anyUsingDHCP(self.devices, anaconda) > > self.ipTable.set_sensitive(state) > >@@ -330,17 +330,6 @@ class NetworkWindow(InstallWindow): > > return numactive > >- def anyUsingDHCP(self): >- for device in self.devices.keys(): >- bootproto = self.devices[device].get("bootproto") >- >- if bootproto and bootproto.lower() in ['query', 'dhcp']: >- onboot = self.devices[device].get("ONBOOT") >- if onboot != "no": >- return 1 >- >- return 0 >- > def onbootToggleCB(self, row, data): > model = self.ethdevices.get_model() > iter = model.get_iter((string.atoi(data),)) >@@ -519,7 +508,7 @@ class NetworkWindow(InstallWindow): > # bring over the value from the loader > self.hostnameEntry.set_text(self.network.hostname) > >- if not self.anyUsingDHCP(): >+ if not network.anyUsingDHCP(self.devices, anaconda): > if self.network.gateway: > self.globals[_("Gateway")].set_text(self.network.gateway) > if self.network.primaryNS: >@@ -541,7 +530,7 @@ class NetworkWindow(InstallWindow): > self.hostnameEntry.set_sensitive(not self.hostnameUseDHCP.get_active()) > self.setIPTableSensitivity() > >- self.hostnameUseDHCP.set_sensitive(self.anyUsingDHCP()) >+ self.hostnameUseDHCP.set_sensitive(network.anyUsingDHCP(self.devices, network)) > > return box > >diff --git a/network.py b/network.py >index a391c78..ff44fcf 100644 >--- a/network.py >+++ b/network.py >@@ -74,14 +74,17 @@ def isPtpDev(devname): > return 0 > > # determine whether any active at boot devices are using dhcp >-def anyUsingDHCP(devices): >+def anyUsingDHCP(devices, anaconda): > for dev in devices.keys(): >- bootproto = devices[dev].get("bootproto") >- if bootproto and bootproto.lower() == "dhcp": >- onboot = devices[dev].get("onboot") >- if onboot and onboot != "no": >- return 1 >- return 0 >+ bootproto = devices[dev].get("bootproto").lower() >+ if bootproto and bootproto in ['query', 'dhcp']: >+ if anaconda.rescue: >+ return True >+ else: >+ onboot = devices[dev].get("onboot") >+ if onboot and onboot != "no": >+ return True >+ return False > > # sanity check an IP string. > def sanityCheckIPString(ip_string): >diff --git a/rescue.py b/rescue.py >index 40d2c8f..b13e95f 100644 >--- a/rescue.py >+++ b/rescue.py >@@ -131,7 +131,7 @@ def startNetworking(network, intf): > log.info("Attempting to start %s", dev.get('device')) > if dev.get('bootproto') == "dhcp": > try: >- ns = isys.pumpNetDevice(dev.get('device')) >+ ns = isys.dhcpNetDevice(dev.get('device')) > if ns: > if not dhcpGotNS: > dhcpGotNS = 1 >diff --git a/scripts/upd-instroot b/scripts/upd-instroot >index 11e7fdf..b85a435 100755 >--- a/scripts/upd-instroot >+++ b/scripts/upd-instroot >@@ -203,7 +203,8 @@ PACKAGESRESCUE="bzip2 bzip2-libs dump groff > findutils ftp gzip iputils joe krb5-libs less man > modutils mtools mt-st mtr net-tools open smartmontools > openssh openssh-clients pciutils rsh traceroute tar rsync >- device-mapper device-mapper-multipath kpartx dmraid" >+ device-mapper device-mapper-multipath kpartx dmraid >+ dhclient dhcpv6-client" > > if [ $ARCH = i386 -o $ARCH = x86_64 ]; then > PACKAGESRESCUE="$PACKAGESRESCUE gpart grub" >@@ -871,6 +872,8 @@ bin/zcat > etc/joe/* > sbin/arp > sbin/depmod >+sbin/dhclient >+sbin/dhcp6c > sbin/dump > sbin/ifconfig > sbin/insmod >diff --git a/textw/network_text.py b/textw/network_text.py >index 7187fdf..a7b6b90 100644 >--- a/textw/network_text.py >+++ b/textw/network_text.py >@@ -260,6 +260,11 @@ class NetworkDeviceWindow: > > def runIPv4Screen(self, screen, dev): > bootproto = dev.get('bootproto').lower() >+ if not bootproto == "query" and \ >+ not bootproto == "dhcp" and \ >+ not bootproto == "static": >+ dev.set(('bootproto', 'dhcp')) >+ bootproto = dev.get('bootproto').lower() > > radio = RadioGroup() > >@@ -688,7 +693,7 @@ class NetworkGlobalWindow: > > # we don't let you set gateway/dns if you've got any interfaces > # using dhcp (for better or worse) >- if network.anyUsingDHCP(devices): >+ if network.anyUsingDHCP(devices, anaconda): > return INSTALL_NOOP > > thegrid = Grid(2, 4) >@@ -776,7 +781,7 @@ class HostnameWindow: > return INSTALL_NOOP > > # figure out if the hostname is currently manually set >- if network.anyUsingDHCP(devices): >+ if network.anyUsingDHCP(devices, anaconda): > if (anaconda.id.network.hostname != "localhost.localdomain" and > anaconda.id.network.overrideDHCPhostname): > manual = 1 >@@ -799,7 +804,7 @@ class HostnameWindow: > anchorLeft = 1) > > # disable the dhcp if we don't have any dhcp >- if network.anyUsingDHCP(devices): >+ if network.anyUsingDHCP(devices, anaconda): > autoCb.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET) > else: > autoCb.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET) >-- >1.5.4.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435978
:
296779
|
298612
|
301575
|
301576
|
301584
|
301585
| 301618 |
301619