Re: [PATCHv4 1/4] net-dhcp-leases: Implement the public APIs

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

 



On 09/26/2013 02:08 AM, Nehal J Wani wrote:
> +
> +typedef struct _virNetworkDHCPLeases virNetworkDHCPLeases;
> +typedef virNetworkDHCPLeases *virNetworkDHCPLeasesPtr;
> +struct _virNetworkDHCPLeases {
> +    long long expirytime;       /* Seconds since epoch */
> +    union {
> +        char *mac;              /* MAC address */
> +        unsigned long iaid;     /* Identity association identifier (IAID) */

'unsigned long' is wrong for any new API.  It is platform dependent, and
makes us have to worry about a 32-bit client talking to a 64-bit host,
and reporting OVERFLOW errors if the host sends back an answer larger
than 32 bits.  If iaid is truly numeric (which I doubt), then use
'unsigned long long'.  But more likely, iaid should be a char* and
treated as an opaque string, rather than trying to treat it as always
being parseable into an integer.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]