1
0
mirror of https://passt.top/passt synced 2024-12-22 05:35:23 +00:00
passt implements a translation layer between a Layer-2 network interface and native Layer-4 sockets (TCP, UDP, ICMP/ICMPv6 echo) on a host. It doesn't require any capabilities or privileges, and it can be used as a simple replacement for Slirp.
Go to file
Stefano Brivio 8bca388e8a passt: Assorted fixes from "fresh eyes" review
A bunch of fixes not worth single commits at this stage, notably:

- make buffer, length parameter ordering consistent in ARP, DHCP,
  NDP handlers

- strict checking of buffer, message and option length in DHCP
  handler (a malicious client could have easily crashed it)

- set up forwarding for IPv4 and IPv6, and masquerading with nft for
  IPv4, from demo script

- get rid of separate slow and fast timers, we don't save any
  overhead that way

- stricter checking of buffer lengths as passed to tap handlers

- proper dequeuing from qemu socket back-end: I accidentally trashed
  messages that were bundled up together in a single tap read
  operation -- the length header tells us what's the size of the next
  frame, but there's no apparent limit to the number of messages we
  get with one single receive

- rework some bits of the TCP state machine, now passive and active
  connection closes appear to be robust -- introduce a new
  FIN_WAIT_1_SOCK_FIN state indicating a FIN_WAIT_1 with a FIN flag
  from socket

- streamline TCP option parsing routine

- track TCP state changes to stderr (this is temporary, proper
  debugging and syslogging support pending)

- observe that multiplying a number by four might very well change
  its value, and this happens to be the case for the data offset
  from the TCP header as we check if it's the same as the total
  length to find out if it's a duplicated ACK segment

- recent estimates suggest that the duration of a millisecond is
  closer to a million nanoseconds than a thousand of them, this
  trend is now reflected into the timespec_diff_ms() convenience
  routine

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2021-02-21 11:55:49 +01:00
doc passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
arp.c passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
arp.h passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
dhcp.c passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
dhcp.h passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
Makefile passt: New design and implementation with native Layer 4 sockets 2021-02-16 09:28:55 +01:00
ndp.c passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
ndp.h passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
passt.c passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
passt.h passt: New design and implementation with native Layer 4 sockets 2021-02-16 09:28:55 +01:00
qrap.c passt: New design and implementation with native Layer 4 sockets 2021-02-16 09:28:55 +01:00
tap.c passt: New design and implementation with native Layer 4 sockets 2021-02-16 09:28:55 +01:00
tap.h passt: New design and implementation with native Layer 4 sockets 2021-02-16 09:28:55 +01:00
tcp.c passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
tcp.h passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
udp.c passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
udp.h passt: New design and implementation with native Layer 4 sockets 2021-02-16 09:28:55 +01:00
util.c passt: Assorted fixes from "fresh eyes" review 2021-02-21 11:55:49 +01:00
util.h passt: New design and implementation with native Layer 4 sockets 2021-02-16 09:28:55 +01:00