lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250901083427.5d9e2a1a@kernel.org>
Date: Mon, 1 Sep 2025 08:34:27 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Brett A C Sheffield <bacs@...recast.net>
Cc: willemdebruijn.kernel@...il.com, davem@...emloft.net,
 edumazet@...gle.com, gregkh@...uxfoundation.org, horms@...nel.org,
 linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
 netdev@...r.kernel.org, pabeni@...hat.com, shuah@...nel.org,
 willemb@...gle.com
Subject: Re: [PATCH net-next v4] selftests: net: add test for ipv6
 fragmentation

On Mon,  1 Sep 2025 12:37:14 +0000 Brett A C Sheffield wrote:
> +static int setup(void)
> +{
> +	struct ifreq ifr = {
> +		.ifr_name = "lo"
> +	};
> +	int fd = -1;
> +	int ctl;
> +
> +	/* we need to set MTU, so do this in a namespace to play nicely */
> +	if (unshare(CLONE_NEWNET) == -1)
> +		error(KSFT_FAIL, errno, "unshare");
> +
> +	ctl = socket(AF_LOCAL, SOCK_STREAM, 0);
> +	if (ctl == -1)
> +		error(KSFT_FAIL, errno, "socket");
> +
> +	/* ensure MTU is smaller than what we plan to send */
> +	ifr.ifr_mtu = MTU;
> +	if (ioctl(ctl, SIOCSIFMTU, &ifr) == -1)
> +		error(KSFT_FAIL, errno, "ioctl: set MTU");
> +
> +	disable_dad("lo");
> +	interface_up(ctl, &ifr);
> +
> +	close(ctl);
> +	return fd;

fd is unused here
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ