Make switchd(8) ignore PACKET_INs generated from looped traffic. Currently,
authorakoshibe <akoshibe@openbsd.org>
Sun, 9 Sep 2018 14:21:32 +0000 (14:21 +0000)
committerakoshibe <akoshibe@openbsd.org>
Sun, 9 Sep 2018 14:21:32 +0000 (14:21 +0000)
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@

usr.sbin/switchd/ofp10.c
usr.sbin/switchd/ofp13.c

index 2264944..14a1426 100644 (file)
@@ -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;
        }
index 9d49e4e..0c40a7d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ofp13.c,v 1.43 2017/01/17 09:21:50 rzalamena Exp $    */
+/*     $OpenBSD: ofp13.c,v 1.44 2018/09/09 14:21:32 akoshibe Exp $     */
 
 /*
  * Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
@@ -1082,7 +1082,8 @@ ofp13_packet_in(struct switchd *sc, struct switch_connection *con,
                 * silently drop looping packet
                 * (don't use OFP_PORT_INPUT here)
                 */
-               dstport = OFP_PORT_ANY;
+               ret = 0;
+               goto done;
        } else {
                addflow = 1;
        }