On Sun, Sep 09, 2018 at 03:17:19AM -0700, Ayaka Koshibe wrote:
> Hi,
>
> This is a new version of a previous diff that I had for making switchd(8)
> ignore PACKET_IN messages generated from looped traffic. Currently, it will
> respond to the PACKET_IN with an invalid PACKET_OUT onto OFP*_PORT_ANY,
> resulting in the switch responding with an error that makes switchd disconnect
> the switch.
>
> I didn't follow through with the previous diff since it seemed to chew up CPU,
> but saw the cause elsewhere after looking at it further. This just improves on
> switchd's behavior.
>
> OK?
Reasoning makes sense so OK claudio@
> Thanks,
> Ayaka
>
>
> Index: usr.sbin/switchd/ofp10.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/switchd/ofp10.c,v
> retrieving revision 1.19
> diff -u -p -u -r1.19 ofp10.c
> --- usr.sbin/switchd/ofp10.c 2 Dec 2016 14:39:46 -0000 1.19
> +++ usr.sbin/switchd/ofp10.c 9 Sep 2018 09:36:33 -0000
> @@ -393,7 +393,8 @@ ofp10_packet_in(struct switchd *sc, stru
> * silently drop looping packet
> * (don't use OFP10_PORT_INPUT here)
> */
> - dstport = OFP10_PORT_ANY;
> + ret = 0;
> + goto done;
> } else {
> addflow = 1;
> }
> Index: usr.sbin/switchd/ofp13.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/switchd/ofp13.c,v
> retrieving revision 1.43
> diff -u -p -u -r1.43 ofp13.c
> --- usr.sbin/switchd/ofp13.c 17 Jan 2017 09:21:50 -0000 1.43
> +++ usr.sbin/switchd/ofp13.c 9 Sep 2018 09:36:33 -0000
> @@ -1082,7 +1082,8 @@ ofp13_packet_in(struct switchd *sc, stru
> * silently drop looping packet
> * (don't use OFP_PORT_INPUT here)
> */
> - dstport = OFP_PORT_ANY;
> + ret = 0;
> + goto done;
> } else {
> addflow = 1;
> }
>
--
:wq Claudio