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

Eric Blake eblake at redhat.com
Wed Oct 2 12:37:05 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131002/f6ec2178/attachment-0001.sig>


More information about the libvir-list mailing list