/*
- * Copyright (c) 2008 Nicira Networks.
+ * Copyright (c) 2008, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <stdlib.h>
#include "dynamic-string.h"
#include "ofpbuf.h"
-
-#define THIS_MODULE VLM_dhcp
#include "vlog.h"
+VLOG_DEFINE_THIS_MODULE(dhcp)
+
/* Information about a DHCP argument type. */
struct arg_type {
const char *name; /* Name. */
{
return ((a->data != NULL) == (b->data != NULL)
&& a->n == b->n
- && !memcmp(a->data, b->data, a->n));
+ && (!a->data || !memcmp(a->data, b->data, a->n)));
}
/* Replaces 'ds' by a string representation of 'msg'. If 'multiline' is
msg->giaddr = dhcp->giaddr;
memcpy(msg->chaddr, dhcp->chaddr, ETH_ADDR_LEN);
- cookie = ofpbuf_try_pull(&b, sizeof cookie);
+ cookie = ofpbuf_try_pull(&b, sizeof *cookie);
if (cookie) {
if (ntohl(*cookie) == DHCP_OPTS_COOKIE) {
uint8_t overload;