port-rewrite2.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Index: portmap.c
  2. ===================================================================
  3. --- portmap.c (revision 967)
  4. +++ portmap.c (working copy)
  5. @@ -214,14 +214,14 @@
  6. tcp_hdr = (tcp_hdr_t *)get_layer4(*ip_hdr);
  7. /* check if we need to remap the destination port */
  8. - newport = htons(map_port(portmap, tcp_hdr->th_dport));
  9. + newport = map_port(portmap, tcp_hdr->th_dport);
  10. if (newport != tcp_hdr->th_dport) {
  11. tcp_hdr->th_dport = newport;
  12. changes ++;
  13. }
  14. /* check if we need to remap the source port */
  15. - newport = htons(map_port(portmap, tcp_hdr->th_sport));
  16. + newport = map_port(portmap, tcp_hdr->th_sport);
  17. if (newport != tcp_hdr->th_sport) {
  18. tcp_hdr->th_sport = newport;
  19. changes ++;
  20. @@ -231,14 +231,14 @@
  21. udp_hdr = (udp_hdr_t *)get_layer4(*ip_hdr);
  22. /* check if we need to remap the destination port */
  23. - newport = htons(map_port(portmap, udp_hdr->uh_dport));
  24. + newport = map_port(portmap, udp_hdr->uh_dport);
  25. if (newport != udp_hdr->uh_dport) {
  26. udp_hdr->uh_dport = newport;
  27. changes ++;
  28. }
  29. /* check if we need to remap the source port */
  30. - newport = htons(map_port(portmap, udp_hdr->uh_sport));
  31. + newport = map_port(portmap, udp_hdr->uh_sport);
  32. if (newport != udp_hdr->uh_sport) {
  33. udp_hdr->uh_sport = newport;
  34. changes ++;