diff options
author | 2016-11-21 08:28:19 +0000 | |
---|---|---|
committer | 2016-11-21 08:28:19 +0000 | |
commit | d352d345cb49eda117c49584136bb67e4ec64ce2 (patch) | |
tree | 2ba76b65a4c58d9c4983181f4b83835c9c20133d | |
parent | bridge(4) does not distinguish between routing/forwarding ports, so (diff) | |
download | wireguard-openbsd-d352d345cb49eda117c49584136bb67e4ec64ce2.tar.xz wireguard-openbsd-d352d345cb49eda117c49584136bb67e4ec64ce2.zip |
Include the OFP header of the message that caused the error on error
messages.
ok reyk@
-rw-r--r-- | sys/net/switchofp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c index 571cfd05811..ddfc5bab523 100644 --- a/sys/net/switchofp.c +++ b/sys/net/switchofp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchofp.c,v 1.34 2016/11/20 12:45:26 reyk Exp $ */ +/* $OpenBSD: switchofp.c,v 1.35 2016/11/21 08:28:19 rzalamena Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -4589,10 +4589,9 @@ swofp_send_error(struct switch_softc *sc, struct mbuf *m, /* Reuse mbuf from request message */ oe = mtod(m, struct ofp_error *); - len = min((ntohs(oe->err_oh.oh_length) - sizeof(struct ofp_header)), - OFP_ERRDATA_MAX); - - m_copydata(m, sizeof(struct ofp_header), len, data); + /* Save data for the response and copy back later. */ + len = min(ntohs(oe->err_oh.oh_length), OFP_ERRDATA_MAX); + m_copydata(m, 0, len, data); oe->err_oh.oh_version = OFP_V_1_3; oe->err_oh.oh_type = OFP_T_ERROR; |