Re: [PATCH rhel6-branch] ipoib support - write TYPE to ifcfg also for disabled devices (#660686)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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\n", device);
>      fprintf(fp, "HWADDR=%s\n", iface_mac2str(device));
> +    char *str_type = netArpTypeStr(device);
> +    if (str_type) fprintf(fp, "TYPE=%s\n", str_type);
> +    free(str_type);
>      uuid = nm_utils_uuid_generate();
>      fprintf(fp, "UUID=%s\n", uuid);
>      g_free(uuid);
> @@ -1346,7 +1349,7 @@ int writeEnabledNetInfo(iface_t *iface) {
>      fprintf(fp, "UUID=%s\n", uuid);
>      g_free(uuid);
>      fprintf(fp, "ONBOOT=yes\n");
> -    char *str_type = netArpTypeStr(iface);
> +    char *str_type = netArpTypeStr(iface->device);
>      if (str_type) fprintf(fp, "TYPE=%s\n", str_type);
>      free(str_type);

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

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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux