[rhel6-branch] Fix ks fetching on nfs via vlan (#1067857)

David Shea dshea at redhat.com
Fri Aug 1 17:26:14 UTC 2014


On 08/01/2014 10:56 AM, Vratislav Podzimek wrote:
> On Fri, 2014-08-01 at 10:06 -0400, Samantha N. Bueno wrote:
>> This just checks the vlan id, which was not being done before.
>>
>> Patch supplied by Masahiro Matsuya <mmatsuya at redhat.com>
>>
>> Resolves: rhbz#1067857
>> ---
>>   loader/nfsinstall.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/loader/nfsinstall.c b/loader/nfsinstall.c
>> index c3019ce..5607fe4 100644
>> --- a/loader/nfsinstall.c
>> +++ b/loader/nfsinstall.c
>> @@ -428,6 +428,7 @@ void setKickstartNfs(struct loaderData_s * loaderData, int argc,
>>   int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
>>       char * host = NULL, *path = NULL, * file = NULL, * opts = NULL;
>>       char * chk = NULL, *ip = NULL;
>> +    char *devicename;
>>       int failed = 0, i = 0;
>>       iface_t iface;
>>       NMClient *client = NULL;
>> @@ -519,8 +520,12 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
>>       }
>>   
>>       /* get the IP of the target system */
>> -    if ((ip = iface_ip2str(loaderData->netDev, AF_INET)) == NULL) {
>> -        logMessage(ERROR, "iface_ip2str returned NULL");
>> +    devicename = loaderData->netDev;
>> +    if (loaderData->vlanid){
>> +        checked_asprintf(&devicename,"%s.%d",loaderData->netDev, loaderData->vlanid);
>> +    }
> You can drop the curly brackets in this if statement if you want to.

I am going to come down on the side of pro-brackets. Especially since 
checked_asprintf is a macro, we'll get a surprise if someone tries to 
add an else without brackets.



More information about the anaconda-patches mailing list