FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 03-01-2012, 05:43 PM
David Cantrell
 
Default ipoib support - write TYPE to ifcfg also for disabled devices (#660686)

Ack, with one comment. I'd prefer the if() statements on a line by
themselves and the fprintf() indented below it.

On Thu, Mar 01, 2012 at 06:08:42PM +0100, Radek Vykydal wrote:
> Related: rhbz#660686
> ---
> loader/net.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/loader/net.c b/loader/net.c
> index 0b0d16d..b4add2b 100644
> --- a/loader/net.c
> +++ b/loader/net.c
> @@ -161,10 +161,10 @@ static void ipCallback(newtComponent co, void * dptr) {
> *
> * This can directly be written into the ifcfg script's TYPE= field.
> */
> -static char *netArpTypeStr(iface_t *iface)
> +static char *netArpTypeStr(const char *ifname)
> {
> char *ret = NULL;
> - int arptype = iface_get_arptype(iface->device);
> + int arptype = iface_get_arptype(ifname);
> switch (arptype) {
> case ARPHRD_ETHER:
> ret = strdup("Ethernet");
> @@ -1236,6 +1236,9 @@ int writeDisabledIfcfgFile(char *device) {
>
> fprintf(fp, "DEVICE=%s
", device);
> fprintf(fp, "HWADDR=%s
", iface_mac2str(device));
> + char *str_type = netArpTypeStr(device);
> + if (str_type) fprintf(fp, "TYPE=%s
", str_type);
> + free(str_type);
> uuid = nm_utils_uuid_generate();
> fprintf(fp, "UUID=%s
", uuid);
> g_free(uuid);
> @@ -1346,7 +1349,7 @@ int writeEnabledNetInfo(iface_t *iface) {
> fprintf(fp, "UUID=%s
", uuid);
> g_free(uuid);
> fprintf(fp, "ONBOOT=yes
");
> - char *str_type = netArpTypeStr(iface);
> + char *str_type = netArpTypeStr(iface->device);
> if (str_type) fprintf(fp, "TYPE=%s
", str_type);
> free(str_type);

--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org