[systemd-devel] [PATCH v2 23/26] dhcp: Process DHCP Ack/Nak message

Lennart Poettering lennart at poettering.net
Mon Nov 25 15:26:43 PST 2013


On Mon, 25.11.13 09:13, Patrik Flykt (patrik.flykt at linux.intel.com) wrote:

> -static int client_receive_offer(DHCPClient *client,
> -                                DHCPPacket *offer, int len)
> +static int client_verify_headers(DHCPClient *client,
> +                                 DHCPPacket *message, int len)

Thhis all looks like "size_t len" is the right param here, not "int".

> +        lease = new0(DHCPLease, 1);
> +        if (!lease)
> +                return -ENOBUFS;

OOM should result in ENOMEM, nothing else please. ENOBUFS is something
else: it indicates some local limit to be hit, not a global memory
shortage.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list