[Midnightbsd-cvs] [MidnightBSD/src] 9e08ff: netstat -i: compute most field widths dynamically

Gordon Bergling noreply at github.com
Sat Aug 19 11:36:46 EDT 2023


  Branch: refs/heads/stable/3.1
  Home:   https://github.com/MidnightBSD/src
  Commit: 9e08ff7c6f6df119837576c0a7a9d4242187dbc7
      https://github.com/MidnightBSD/src/commit/9e08ff7c6f6df119837576c0a7a9d4242187dbc7
  Author: Mike Karels <karels at FreeBSD.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M usr.bin/netstat/if.c
    M usr.bin/netstat/netstat.1

  Log Message:
  -----------
  netstat -i: compute most field widths dynamically

The network and address fields were sometimes truncated for netstat -i
without -W, and often much too wide for netstat -i with the -W option.
Fields such as normal packet counts often overflowed.  As a result,
columns didn't line up, and large white spaces made it harder to
follow a line across the display.  Change the code to compute the
required field sizes for network, address, and various packet counts.
Hoist the code to format network and address into a subroutine that
can be called twice, once to measure the required field widths,
and once to emit the values.  Use separate field widths for input
and output packets, byte counts, and error and drop counters.
These are left at defaults (the preceding values) with the -h
option, in which case the fields have a limited total width.
An extra space is included between the Network and Address, which
otherwise seemed too close.

Change the mention of -W with -i in the man page to say that most
field widths are computed dynamically in this case.

Reviewed by:	sjg, glebius
Differential Revision:	https://reviews.freebsd.org/D41160

(cherry picked from commit 372e3d561d82aba7a66fcd4ecb49a4d0a9f69345)


  Commit: 9431b464bc1d4e1519feb4a336b9ed68d5541af7
      https://github.com/MidnightBSD/src/commit/9431b464bc1d4e1519feb4a336b9ed68d5541af7
  Author: Gordon Bergling <gbe at FreeBSD.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M sys/dev/sk/if_sk.c

  Log Message:
  -----------
  sk(4): Fix a typo in a source code comment

- s/nomral/normal/

(cherry picked from commit 135c2b71562f6a6b8e918cc66d5468342c198d02)


  Commit: 1e9d2512eb427a87a10b1b5f403cc2069dcc919c
      https://github.com/MidnightBSD/src/commit/1e9d2512eb427a87a10b1b5f403cc2069dcc919c
  Author: Kristof Provost <kp at FreeBSD.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M sys/netpfil/pf/pf_norm.c

  Log Message:
  -----------
  pf: handle multiple IPv6 fragment headers

With 'scrub fragment reassemble' if a packet contains multiple IPv6
fragment headers we would reassemble the packet and immediately
continue processing it.

That is, we'd remove the first fragment header and expect the next
header to be a final header (i.e. TCP, UDP, ICMPv6, ...). However, if
it's another fragment header we'd not treat the packet correctly.
That is, we'd fail to recognise the payload and treat it as if it were
an IPv6 fragment rather than as its actual payload.

Fix this by restarting the normalisation on the reassembled packet.
If there are multiple fragment headers drop the packet.

Reported by:	Enrico Bassetti bassetti at di.uniroma1.it (NetSecurityLab @ Sapienza University of Rome)
MFC after:	instant
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 76afcbb52492f9b3e72ee7d4c4ed0a54c25e1c48)


  Commit: 048dec733372bf4c80e1ebba8bc954f44b1da8d1
      https://github.com/MidnightBSD/src/commit/048dec733372bf4c80e1ebba8bc954f44b1da8d1
  Author: Gordon Bergling <gbe at FreeBSD.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M sys/fs/nfsserver/nfs_nfsdstate.c

  Log Message:
  -----------
  nfsserver: Fix a typo in a source code comment

- s/restared/restarted/

(cherry picked from commit 11892bc710a741a03735b164dc089d40d7d80374)


  Commit: 1daa8a1104f597869e2251f17c00a9473d69c1f6
      https://github.com/MidnightBSD/src/commit/1daa8a1104f597869e2251f17c00a9473d69c1f6
  Author: Gordon Bergling <gbe at FreeBSD.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M sys/netpfil/ipfilter/netinet/ip_state.c

  Log Message:
  -----------
  netpfil: Fix a typo in a source code comment

- s/interprted/interpreted/

(cherry picked from commit cfd05de1946799c6353b07da5d351027d8471203)


  Commit: db4d5cfdc2f8cf194d69ee8d068da9c353fed24c
      https://github.com/MidnightBSD/src/commit/db4d5cfdc2f8cf194d69ee8d068da9c353fed24c
  Author: Gordon Bergling <gbe at FreeBSD.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M sys/dev/aic7xxx/aic79xx.c
    M sys/dev/aic7xxx/aic7xxx.c

  Log Message:
  -----------
  aic7xxx: Fix two typos in source code comments

- s/reslection/reselection/

(cherry picked from commit 3514686b344da607515decb500018d25aadacd33)


Compare: https://github.com/MidnightBSD/src/compare/f70e017df7f4...db4d5cfdc2f8


More information about the Midnightbsd-cvs mailing list