summaryrefslogtreecommitdiffstats
path: root/usr.sbin/switchd/ofp10.c
diff options
context:
space:
mode:
authorakoshibe <akoshibe@openbsd.org>2018-09-09 14:21:32 +0000
committerakoshibe <akoshibe@openbsd.org>2018-09-09 14:21:32 +0000
commitc1a46f8da14c482d23526df1dd585fe64746b3cb (patch)
tree793eee7b7c704a902cdcbc7556e277901a519f7a /usr.sbin/switchd/ofp10.c
parentuse TAILQ_CONCAT in filterset_move(). ok claudio@ (diff)
downloadwireguard-openbsd-c1a46f8da14c482d23526df1dd585fe64746b3cb.tar.xz
wireguard-openbsd-c1a46f8da14c482d23526df1dd585fe64746b3cb.zip
Make switchd(8) ignore PACKET_INs generated from looped traffic. Currently,
it responds to these messages with an invalid PACKET_OUT onto OFP*_PORT_ANY, resulting in the switch responding with an error, causing switchd to disconnect the switch. OK phessler@ claudio@
Diffstat (limited to 'usr.sbin/switchd/ofp10.c')
-rw-r--r--usr.sbin/switchd/ofp10.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/switchd/ofp10.c b/usr.sbin/switchd/ofp10.c
index 22649448f00..14a14267c48 100644
--- a/usr.sbin/switchd/ofp10.c
+++ b/usr.sbin/switchd/ofp10.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofp10.c,v 1.19 2016/12/02 14:39:46 rzalamena Exp $ */
+/* $OpenBSD: ofp10.c,v 1.20 2018/09/09 14:21:32 akoshibe Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
@@ -393,7 +393,8 @@ ofp10_packet_in(struct switchd *sc, struct switch_connection *con,
* silently drop looping packet
* (don't use OFP10_PORT_INPUT here)
*/
- dstport = OFP10_PORT_ANY;
+ ret = 0;
+ goto done;
} else {
addflow = 1;
}