*/
#include <config.h>
+#include <sys/types.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#include "openvswitch/ofp-ed-props.h"
-#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
#include "openvswitch/ofp-parse.h"
#include "util.h"
size_t len = (*ofp_prop)->len;
size_t pad_len = ROUND_UP(len, 8);
- if (pad_len > *remaining) {
+ if (len < sizeof **ofp_prop || pad_len > *remaining) {
return OFPERR_OFPBAC_BAD_LEN;
}
return OFPERR_NXBAC_BAD_ED_PROP;
}
struct ofpact_ed_prop_nsh_md_type *pnmt =
- ofpbuf_put_uninit(out, sizeof(*pnmt));
+ ofpbuf_put_zeros(out, sizeof *pnmt);
pnmt->header.prop_class = prop_class;
pnmt->header.type = prop_type;
pnmt->header.len = len;
opnmt->header.len =
offsetof(struct ofp_ed_prop_nsh_md_type, pad);
opnmt->md_type = pnmt->md_type;
+ memset(opnmt->pad, 0, sizeof opnmt->pad);
prop_len = sizeof(*pnmt);
break;
}