summaryrefslogtreecommitdiff
path: root/sys/net/switchofp.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@cvs.openbsd.org>2016-10-28 09:01:50 +0000
committerRafael Zalamena <rzalamena@cvs.openbsd.org>2016-10-28 09:01:50 +0000
commit54b26813c5969406e5eef70c44448aaf62c3498c (patch)
treea0d455116080d2f3a32f0be38006b945ee43103e /sys/net/switchofp.c
parentd35485ba9ba0b979a305223c6cf140a4b3994967 (diff)
When doing pktout we must run the classifier again, because some action(s)
might want to use it. For buffered packets we probably need to save that somehow else, but we don't support it now. ok reyk@
Diffstat (limited to 'sys/net/switchofp.c')
-rw-r--r--sys/net/switchofp.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c
index 27d39a832e0..4c356c10018 100644
--- a/sys/net/switchofp.c
+++ b/sys/net/switchofp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchofp.c,v 1.17 2016/10/27 09:48:01 jsg Exp $ */
+/* $OpenBSD: switchofp.c,v 1.18 2016/10/28 09:01:49 rzalamena Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
@@ -5084,7 +5084,7 @@ swofp_recv_packet_out(struct switch_softc *sc, struct mbuf *m)
pout = mtod(m, struct ofp_packet_out *);
al_start = offsetof(struct ofp_packet_out, pout_actions);
- if (pout->pout_buffer_id != OFP_CONTROLLER_MAXLEN_NO_BUFFER) {
+ if (pout->pout_buffer_id == OFP_PKTOUT_NO_BUFFER) {
/*
* It's not necessary to deep copy at here because it's done
* in m_dup_pkt().
@@ -5102,6 +5102,17 @@ swofp_recv_packet_out(struct switch_softc *sc, struct mbuf *m)
}
mc = mcn;
+ } else {
+ /* TODO We don't do buffering yet. */
+ swofp_send_error(sc, m, OFP_ERRTYPE_BAD_REQUEST,
+ OFP_ERRREQ_BUFFER_UNKNOWN);
+ return (0);
+ }
+
+ mc = switch_flow_classifier(mc, pout->pout_in_port, &swfcl);
+ if (mc == NULL) {
+ m_freem(m);
+ return (0);
}
TAILQ_INIT(&swpld.swpld_fwdp_q);