If you would like to send a packet out the same port that it came in on, the virtual port `OFPP_IN_PORT` should be specified. It's not common that traffic is sent backwards (it's kind of like looping matched packets), so this requires a specially defined port. Changing the `msg3.out_port = of_ports[1]` back to `msg3.out_port = of_ports[2]` would solve this.

I think that's all that needs to be addressed in this pull request.