Packet switching / forwarding with FreeRTOS TCP Multi

I’m planning to implement packet switching in embedded device with FreeRTOS TCP/IP Multi.
about device

  1. having 2 physical ethernet ports both having respective MAC & IP address
  2. each interface have single endpoint.

about switching behavior,
I require device looks for destination MAC address and compare with its own MACs and determines the outgoing interface port and forward the frame to designated port

switching and forwarding to other interface need guidance.

I think the stack uses the IP address and netmask to decide which interface to send though, and will always select the first interface that matches the requirements (i.e. is on the same subnet).