[PATCH v4 2/4] app/rpcapd: remote pcap daemon

Marat Khalili qm2k21 at gmail.com
Thu Oct 1 20:50:22 CEST 2026


Two non-critical nits inline.

On 01/10/2026 03:35, Stephen Hemminger wrote:
> +static void
> +parse_bind_addr(void)
> +{
> +	struct addrinfo hints = {
> +		.ai_family   = bind_family,
> +		.ai_socktype = SOCK_STREAM,
> +		.ai_flags    = AI_NUMERICHOST | AI_PASSIVE,
> +	};
> +	struct addrinfo *res;
> +	int rc;
> +
> +	/* Loopback by default; the wildcard address is not a safe default. */
> +	if (bind_addr == NULL)
> +		bind_addr = (bind_family == AF_INET6) ? "::1" : "127.0.0.1";
When neither `bind_addr` nor `bind_family` are specified, can we bind to 
all local addresses (127.0.0.1, ::1) that exist in the system? Or at 
least to the first of them that exists, to improve the user experience 
on IPv6-only systems a little?
> +
> +	rc = getaddrinfo(bind_addr, NULL, &hints, &res);
> +	if (rc != 0)
> +		rte_exit(EXIT_FAILURE, "Invalid bind address '%s': %s\n",
> +			 bind_addr, gai_strerror(rc));
> +	memcpy(&listen_addr, res->ai_addr, res->ai_addrlen);
> +	listen_addrlen = res->ai_addrlen;
> +	freeaddrinfo(res);
> +}
// ...
> +/* Largest snaplen a client can be given. */
> +#define DEFAULT_SNAPLEN		RTE_MBUF_DEFAULT_DATAROOM

The naming is not optimal, it's upper limit not default.



More information about the dev mailing list