correct packet dispatching in divert(4)

Sepherosa Ziehau sepherosa at
Thu Dec 13 06:20:42 PST 2007


Following patch corrects the packet dispatching in div_output():

Changes in the above patch:
- Add mbuf** parameter to protosw.pr_mport
- Pass 'addr' to pr_mport() in so_pru_send(); udp_soport() is adjusted
- Change ip_mport(), so it will do the same thing as udp_soport() if
called on an outgoing UDP packet
- Add div_soport():
  o  Delegate non-PRU_SEND operation to cpu0_soport()
  o  Move receiving interface setting up code from div_output() into
this function, so ip_mport() could be called
  o  Use ip_mport() to find the target lwkt port
With the above changes, I would not need to do two back-to-back msg
dispatching (one in so_pru_send() to netisr on CPU0, another in
div_output() to the real target lwkt port); a packet is sent to the
target lwkt port directly.

Please review it.

Best Regards,

Live Free or Die

More information about the Submit mailing list