+ /* Get in_port and partially validate it.
+ *
+ * We don't know what range of ports the ofproto actually implements, but
+ * we do know that only certain reserved ports (numbered OFPP_MAX and
+ * above) are valid. */
+ in_port = ntohs(opo->in_port);
+ if (in_port >= OFPP_MAX && in_port != OFPP_LOCAL && in_port != OFPP_NONE) {
+ return ofp_mkerr_nicira(OFPET_BAD_REQUEST, NXBRC_BAD_IN_PORT);
+ }
+