diff options
author | David Cantrell <dcantrell@redhat.com> | 2007-01-05 20:49:21 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2007-01-05 20:49:21 +0000 |
commit | d586478fa2173640d836d9c8c1bf171d56330543 (patch) | |
tree | 5f5c59261d90fec5779a5724b071d3fa131e1da9 /isys | |
parent | 9bc283541c788a762396398c57cb5ac663e7f23c (diff) | |
download | anaconda-d586478fa2173640d836d9c8c1bf171d56330543.tar.gz anaconda-d586478fa2173640d836d9c8c1bf171d56330543.tar.xz anaconda-d586478fa2173640d836d9c8c1bf171d56330543.zip |
If dhcpclass is empty, build one from uname() like
'Linux 2.6.18-1.2869.fc6 i686' (#220082).
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/isys/isys.c b/isys/isys.c index 0d5e556d4..2cb9bcf7b 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -619,6 +619,7 @@ static PyObject * doDhcpNetDevice(PyObject * s, PyObject * args) { char buf[47]; time_t timeout = 45; struct pumpNetIntf cfg; + struct utsname kv; /* FIXME: we call this from rescue mode, need to pass in what user wants */ DHCP_Preference pref = DHCPv6_DISABLE; ip_addr_t *tip; @@ -627,8 +628,12 @@ static PyObject * doDhcpNetDevice(PyObject * s, PyObject * args) { if (!PyArg_ParseTuple(args, "s|s", &device, &dhcpclass)) return NULL; - if (dhcpclass == NULL) - dhcpclass = "anaconda"; + if (dhcpclass == NULL) { + if (uname(&kv) == -1) + dhcpclass = "anaconda"; + else + asprintf(&dhcpclass, "%s %s %s", kv.sysname,kv.release,kv.machine); + } memset(&cfg, '\0', sizeof(cfg)); strncpy(cfg.device, device, sizeof(cfg.device) - 1); |