Browse Source

Use -ENOSPC rather than -ENOMEM, to distinguish the cases "generic out of

memory" and "no space left for DHCP options"
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
4f506328ad
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      src/core/settings.c

+ 5
- 5
src/core/settings.c View File

212
 	option = set_dhcp_option ( context->options, setting->tag,
212
 	option = set_dhcp_option ( context->options, setting->tag,
213
 				   value, strlen ( value ) );
213
 				   value, strlen ( value ) );
214
 	if ( ! option )
214
 	if ( ! option )
215
-		return -ENOMEM;
215
+		return -ENOSPC;
216
 	return 0;
216
 	return 0;
217
 }
217
 }
218
 
218
 
261
 	struct in_addr ipv4;
261
 	struct in_addr ipv4;
262
 	int rc;
262
 	int rc;
263
 	
263
 	
264
-	if ( ( rc = inet_aton ( value, &ipv4 ) ) == 0 )
265
-		return rc;
264
+	if ( inet_aton ( value, &ipv4 ) == 0 )
265
+		return -EINVAL;
266
 	option = set_dhcp_option ( context->options, setting->tag,
266
 	option = set_dhcp_option ( context->options, setting->tag,
267
 				   &ipv4, sizeof ( ipv4 ) );
267
 				   &ipv4, sizeof ( ipv4 ) );
268
 	if ( ! option )
268
 	if ( ! option )
269
-		return -ENOMEM;
269
+		return -ENOSPC;
270
 	return 0;
270
 	return 0;
271
 }
271
 }
272
 
272
 
330
 	option = set_dhcp_option ( context->options, setting->tag,
330
 	option = set_dhcp_option ( context->options, setting->tag,
331
 				   &u.bytes[ sizeof ( u ) - size ], size );
331
 				   &u.bytes[ sizeof ( u ) - size ], size );
332
 	if ( ! option )
332
 	if ( ! option )
333
-		return -ENOMEM;
333
+		return -ENOSPC;
334
 	return 0;
334
 	return 0;
335
 }
335
 }
336
 
336
 

Loading…
Cancel
Save