fix portnum api bug and change its usage in rx handling code
Merge branch 'tx_batching' into tx_revision