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 298612 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-sure-DHCP-works-in-rescue-mode-435978.patch
0001-Make-sure-DHCP-works-in-rescue-mode-435978.patch (text/plain), 4.45 KB, created by
David Cantrell
on 2008-03-19 23:48:49 UTC
(
hide
)
Description:
0001-Make-sure-DHCP-works-in-rescue-mode-435978.patch
Filename:
MIME Type:
Creator:
David Cantrell
Created:
2008-03-19 23:48:49 UTC
Size:
4.45 KB
patch
obsolete
>From 4d7c200bb8e4584f2b8aa24711e6d3eed33ea1da Mon Sep 17 00:00:00 2001 >From: David Cantrell <dcantrell@redhat.com> >Date: Wed, 19 Mar 2008 13:42:10 -1000 >Subject: [PATCH] Make sure DHCP works in rescue mode (#435978). > >This is a regression from RHEL 5.1. The libdhcp changes have >caused some bizarre behavior in anaconda's libisys. Due to the >inherently unstable nature of libdhcp and the long-term plan to >remove that library entirely, working within the contraints of >the current limitations seemed easier than further working on >libdhcp. > >So, in isys.c, the doDhcpNetDevice() function has been updated >to work more like doDhcp() in loader2/net.c, which was changed >in commit 732d0e842527da64933488a610b40927b2ca2c02. >--- > isys/isys.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++------------ > 1 files changed, 74 insertions(+), 20 deletions(-) > >diff --git a/isys/isys.c b/isys/isys.c >index ef9a5a5..d27425a 100644 >--- a/isys/isys.c >+++ b/isys/isys.c >@@ -1,5 +1,8 @@ > #include <Python.h> > >+#include <sys/shm.h> >+#include <sys/types.h> >+#include <sys/wait.h> > #include <stdio.h> > #include <dirent.h> > #include <errno.h> >@@ -611,46 +614,97 @@ static PyObject * doConfigNetDevice(PyObject * s, PyObject * args) { > return Py_None; > } > >-/* FIXME: add IPv6 support once the UI changes are made --dcantrell */ > static PyObject * doDhcpNetDevice(PyObject * s, PyObject * args) { >- char * device; >- char * dhcpclass = NULL; >- char * r; >+ char * device = NULL; >+ char * class = NULL; >+ char * r = NULL; > char buf[47]; > time_t timeout = 45; >- struct pumpNetIntf cfg; >+ struct pumpNetIntf *pumpdev = NULL; > /* FIXME: we call this from rescue mode, need to pass in what user wants */ >- DHCP_Preference pref = DHCPv6_DISABLE; >+ DHCP_Preference pref = DHCPv6_DISABLE_RESOLVER|DHCPv4_DISABLE_HOSTNAME_SET; >+ int status, shmpump, i; >+ pid_t pid; >+ key_t key; > ip_addr_t *tip; > PyObject * rc; > >- if (!PyArg_ParseTuple(args, "s|s", &device, &dhcpclass)) >+ if (!PyArg_ParseTuple(args, "s|s", &device, &class)) > return NULL; > >- if (dhcpclass == NULL) >- dhcpclass = "anaconda"; >+ if (class == NULL) >+ class = "anaconda"; > >- memset(&cfg, '\0', sizeof(cfg)); >- strncpy(cfg.device, device, sizeof(cfg.device) - 1); >+ if ((key = ftok("/tmp", 'Y')) == -1) { >+ Py_INCREF(Py_None); >+ return Py_None; >+ } > >- r = pumpDhcpClassRun(&cfg, 0L, dhcpclass, pref, 0, timeout, NULL, 0L); >- if (r) { >+ shmpump = shmget(key, 4096, IPC_CREAT | IPC_EXCL | 0600); >+ if (shmpump == -1) { > Py_INCREF(Py_None); > return Py_None; > } > >- r = pumpSetupInterface(&cfg); >- if (r) { >+ pumpdev = (struct pumpNetIntf *) shmat(shmpump, (void *) pumpdev, SHM_RND); >+ if (((void *) pumpdev) == ((void *) -1)) { > Py_INCREF(Py_None); > return Py_None; > } > >- if (cfg.numDns) { >- tip = &(cfg.dnsServers[0]); >- inet_ntop(tip->sa_family, IP_ADDR(tip), buf, IP_STRLEN(tip)); >- rc = PyString_FromString(buf); >+ strncpy(pumpdev->device, device, IF_NAMESIZE); >+ >+ /* call libdhcp in a separate process because libdhcp is bad */ >+ pid = fork(); >+ if (pid == 0) { >+ r = pumpDhcpClassRun(pumpdev, NULL, class, pref, 0, timeout, NULL, 0); >+ if (r != NULL) { >+ exit(1); >+ } >+ >+ if (pumpdev->dhcp_nic) { >+ i = dhcp_nic_configure(pumpdev->dhcp_nic); >+ >+ dhcp_nic_free(pumpdev->dhcp_nic); >+ pumpdev->dhcp_nic = NULL; >+ >+ if (i < 0) { >+ exit(2); >+ } >+ } >+ >+ r = pumpSetupInterface(pumpdev); >+ if (r != NULL) { >+ exit(3); >+ } >+ >+ exit(0); >+ } else if (pid == -1) { >+ Py_INCREF(Py_None); >+ return Py_None; > } else { >- rc = PyString_FromString(""); >+ if (waitpid(pid, &status, 0) == -1) { >+ Py_INCREF(Py_None); >+ return Py_None; >+ } >+ >+ if (pumpdev->numDns) { >+ tip = &(pumpdev->dnsServers[0]); >+ inet_ntop(tip->sa_family, IP_ADDR(tip), buf, IP_STRLEN(tip)); >+ rc = PyString_FromString(buf); >+ } else { >+ rc = PyString_FromString(""); >+ } >+ >+ if (shmdt(pumpdev) == -1) { >+ Py_INCREF(Py_None); >+ return Py_None; >+ } >+ >+ if (shmctl(shmpump, IPC_RMID, 0) == -1) { >+ Py_INCREF(Py_None); >+ return Py_None; >+ } > } > > return rc; >-- >1.5.4.3 >
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