Skip to content

Changes

Started by upstream project gerrit-osmo-pcap #255
Started 20 hr ago
Queued 41 sec
vty: clamp configured snaplen to the wire-framing limit

osmo-pcap carries each captured packet in a frame whose length field
(struct osmo_pcap_data.len) is a uint16_t, so any snaplen above ~64 KiB
cannot be transported and is silently clamped by the server when sizing
its receive buffer (calc_data_max_len() caps at UINT16_MAX). The VTY,
however, advertised libpcap's MAXIMUM_SNAPLEN (262144), misleading users
into configuring values that never take effect.

Introduce OSMO_PCAP_MAX_SNAPLEN (65535) and, in both the client "pcap
snaplen" and server "max-snaplen" handlers, warn and cap the value to it
when a larger one is given. The command syntax keeps the <1-262144>
range for backwards compatibility so existing configs still parse; the
help text now documents the effective 64 KiB limit.

Change-Id: Ia56cad48e8cefe8ae103f2f7d2e037bf28438b71
AI-Assisted: yes (Claude)
Related: 6d2f7c52 ("server: Limit rx buffer size to UINT16_MAX")
Related: SYS#8099
Vadim Yanitskiy at