net: ipv4: Move ip_options_fragment() out of loop
authorYajun Deng <yajun.deng@linux.dev>
Mon, 23 Aug 2021 03:17:59 +0000 (11:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Feb 2022 16:25:46 +0000 (17:25 +0100)
commit2f56c4845df93c509ea3a63588fd4251ef5c5c87
treefa260098772111c5f7711ad19fd0a7766b93e177
parent55402a4618721f350a9ab660bb42717d8aa18e7c
net: ipv4: Move ip_options_fragment() out of loop

[ Upstream commit faf482ca196a5b16007190529b3b2dd32ab3f761 ]

The ip_options_fragment() only called when iter->offset is equal to zero,
so move it out of loop, and inline 'Copy the flags to each fragment.'
As also, remove the unused parameter in ip_frag_ipcb().

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/ip_output.c