-/* $OpenBSD: ofcconn.c,v 1.3 2016/07/19 18:04:04 reyk Exp $ */
+/* $OpenBSD: ofcconn.c,v 1.4 2016/07/19 18:11:08 reyk Exp $ */
/*
* Copyright (c) 2016 YASUOKA Masahiko <yasuoka@openbsd.org>
{
struct ofcconn *oc = ctx;
static char buf[65536];/* max size of OpenFlow message */
- size_t sz, sz2;
+ ssize_t sz, sz2;
struct ofp_header *hdr;
if (evmask & EV_WRITE) {
hdr.oh_length = htons(sizeof(hdr));
hdr.oh_xid = htonl(0xffffffffUL);
- if ((sz = write(oc->oc_sock, &hdr, sizeof(hdr))) != sz) {
+ sz = sizeof(hdr);
+ if (write(oc->oc_sock, &hdr, sz) != sz) {
log_warn("%s: %s write", __func__, oc->oc_device);
ofcconn_close(oc);
ofcconn_connect_again(oc);
-/* $OpenBSD: ofp.c,v 1.1 2016/07/19 16:54:26 reyk Exp $ */
+/* $OpenBSD: ofp.c,v 1.2 2016/07/19 18:11:08 reyk Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
struct iovec iov[2];
int cnt = 0;
void *data;
- size_t len;
+ ssize_t len;
if (oh != NULL) {
iov[cnt].iov_base = oh;
-/* $OpenBSD: ofp10.c,v 1.1 2016/07/19 16:54:26 reyk Exp $ */
+/* $OpenBSD: ofp10.c,v 1.2 2016/07/19 18:11:08 reyk Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
off += sizeof(*pout);
while ((ah = ibuf_seek(ibuf, off, len)) != NULL &&
- ntohs(ah->ah_len) >= sizeof(*ah)) {
+ ntohs(ah->ah_len) >= (uint16_t)sizeof(*ah)) {
switch (ntohs(ah->ah_type)) {
case OFP10_ACTION_OUTPUT:
ao = (struct ofp10_action_output *)ah;