mirror of https://github.com/ipxe/ipxe.git
Use -ENOSPC rather than -ENOMEM, to distinguish the cases "generic out of
memory" and "no space left for DHCP options"pull/1/head
parent
637a891264
commit
4f506328ad
|
@ -212,7 +212,7 @@ static int set_string ( struct config_context *context,
|
||||||
option = set_dhcp_option ( context->options, setting->tag,
|
option = set_dhcp_option ( context->options, setting->tag,
|
||||||
value, strlen ( value ) );
|
value, strlen ( value ) );
|
||||||
if ( ! option )
|
if ( ! option )
|
||||||
return -ENOMEM;
|
return -ENOSPC;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,12 +261,12 @@ static int set_ipv4 ( struct config_context *context,
|
||||||
struct in_addr ipv4;
|
struct in_addr ipv4;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if ( ( rc = inet_aton ( value, &ipv4 ) ) == 0 )
|
if ( inet_aton ( value, &ipv4 ) == 0 )
|
||||||
return rc;
|
return -EINVAL;
|
||||||
option = set_dhcp_option ( context->options, setting->tag,
|
option = set_dhcp_option ( context->options, setting->tag,
|
||||||
&ipv4, sizeof ( ipv4 ) );
|
&ipv4, sizeof ( ipv4 ) );
|
||||||
if ( ! option )
|
if ( ! option )
|
||||||
return -ENOMEM;
|
return -ENOSPC;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ static int set_int ( struct config_context *context,
|
||||||
option = set_dhcp_option ( context->options, setting->tag,
|
option = set_dhcp_option ( context->options, setting->tag,
|
||||||
&u.bytes[ sizeof ( u ) - size ], size );
|
&u.bytes[ sizeof ( u ) - size ], size );
|
||||||
if ( ! option )
|
if ( ! option )
|
||||||
return -ENOMEM;
|
return -ENOSPC;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue