
+/** + * VIR_NETWORK_DHCP_LEASE_FILE_SIZE_MAX: + * + * Macro providing the upper limit on the size of leases file + */ +#define VIR_NETWORK_DHCP_LEASE_FILE_SIZE_MAX (2 * 1024 * 1024)
Do you think this is large enough ? Lets imagine a case of 65,000 leases - will they all fit in 2 MB given the JSON formatting we're doing ?
The following JSON formatted lease takes 274 bytes: { "iaid": "1221229", "ip-address": "2001:db8:ca2:2:1::95", "mac-address": "52:54:00:12:a2:6d", "hostname": "Fedora20", "client-id": "00:04:1a:c1:d9:6b:5a:0a:e2:bc:f8:4b:1e:37:2e:38:22:55", "expiry-time": 1393244216 }, So, assuming an upper limit of 512 bytes for each such entry, is it safe to change the above limit to 32 MB?
+ /* In case hostname is known, it is the 5th argument */ + if (argc == 5) + hostname = argv[4];
Looks like a '<tab>' character in the source - use 'make syntax-check' to avoid that.
I did run make syntax-check, but it didn't throw any error. Maybe some hacks will be required to enable checks on this source file. -- Nehal J Wani