summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@cvs.openbsd.org>2016-09-26 08:55:44 +0000
committerRafael Zalamena <rzalamena@cvs.openbsd.org>2016-09-26 08:55:44 +0000
commit3920b9d217ce9db970778b71e2ffe2510d753a81 (patch)
tree5093b222eba5d1eb1783b023bb6085ade19bff69 /usr.sbin
parentb949100da3d9dede714031ca16759107247742fc (diff)
Set pkt_buf variable on incoming packet_in messages.
small style correction and ok reyk@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/switchd/packet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/switchd/packet.c b/usr.sbin/switchd/packet.c
index b24b8528abb..7e4d6d66660 100644
--- a/usr.sbin/switchd/packet.c
+++ b/usr.sbin/switchd/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.3 2016/07/21 08:39:23 reyk Exp $ */
+/* $OpenBSD: packet.c,v 1.4 2016/09/26 08:55:43 rzalamena Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
@@ -63,7 +63,7 @@ packet_input(struct switchd *sc, struct switch_control *sw, uint32_t srcport,
return (-1);
pkt->pkt_len = ibuf_dataleft(ibuf);
- if ((pkt->pkt_eh = eh = ibuf_getdata(ibuf, sizeof(*eh))) == NULL) {
+ if ((eh = ibuf_getdata(ibuf, sizeof(*eh))) == NULL) {
log_debug("short packet");
return (-1);
}
@@ -87,5 +87,8 @@ packet_input(struct switchd *sc, struct switch_control *sw, uint32_t srcport,
if (dstport)
*dstport = dst == NULL ? OFP_PORT_ANY : dst->mac_port;
+ pkt->pkt_eh = eh;
+ pkt->pkt_buf = (uint8_t *)eh;
+
return (0);
}