public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH 0/8] Clean up and fix bugs in port forwarding data structures
@ 2022-09-23  4:57 David Gibson
  2022-09-23  4:57 ` [PATCH 1/8] Improve types and names for port forwarding configuration David Gibson
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: David Gibson @ 2022-09-23  4:57 UTC (permalink / raw)
  To: passt-dev

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

The information we need to keep track of which ports are forwarded
where is currently split across several different values and data
structures in several different places.  Worse, a number of those
structures are incorrectly sized due to an off by one error, which
could lead to buffer overruns.

Fix the sizing, and re-organize the data structures in a way that
should make it less likely to repeat that mistake.

While we're there, correct a similar off-by-one mis-sizing of a number
of other arrays.

David Gibson (8):
  Improve types and names for port forwarding configuration
  Consolidate port forwarding configuration into a common structure
  udp: Delay initialization of UDP reversed port mapping table
  Don't use indirect remap functions for conf_ports()
  Pass entire port forwarding configuration substructure to conf_ports()
  Treat port numbers as unsigned
  Fix widespread off-by-one error dealing with port numbers
  icmp: Correct off by one errors dealing with number of echo request
    ids

 Makefile     |   2 +-
 conf.c       | 136 +++++++++++++++++++++++----------------------------
 icmp.c       |   5 +-
 passt.h      |   1 +
 port_fwd.h   |  34 +++++++++++++
 tcp.c        |  68 ++++++++------------------
 tcp.h        |  13 ++---
 tcp_splice.c |   4 +-
 udp.c        |  59 ++++++++++------------
 udp.h        |  27 +++++-----
 10 files changed, 168 insertions(+), 181 deletions(-)
 create mode 100644 port_fwd.h

-- 
2.37.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-09-24  9:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23  4:57 [PATCH 0/8] Clean up and fix bugs in port forwarding data structures David Gibson
2022-09-23  4:57 ` [PATCH 1/8] Improve types and names for port forwarding configuration David Gibson
2022-09-23 22:52   ` Stefano Brivio
2022-09-24  2:57     ` David Gibson
2022-09-24  6:28       ` Stefano Brivio
2022-09-24  9:06         ` David Gibson
2022-09-23  4:58 ` [PATCH 2/8] Consolidate port forwarding configuration into a common structure David Gibson
2022-09-23  4:58 ` [PATCH 3/8] udp: Delay initialization of UDP reversed port mapping table David Gibson
2022-09-23  4:58 ` [PATCH 4/8] Don't use indirect remap functions for conf_ports() David Gibson
2022-09-23  4:58 ` [PATCH 5/8] Pass entire port forwarding configuration substructure to conf_ports() David Gibson
2022-09-23  4:58 ` [PATCH 6/8] Treat port numbers as unsigned David Gibson
2022-09-23  4:58 ` [PATCH 7/8] Fix widespread off-by-one error dealing with port numbers David Gibson
2022-09-23  4:58 ` [PATCH 8/8] icmp: Correct off by one errors dealing with number of echo request ids David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).