netpoll: factor out IPv4 header setup into push_ipv4() helper
authorBreno Leitao <leitao@debian.org>
Wed, 2 Jul 2025 10:06:36 +0000 (03:06 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Jul 2025 01:52:56 +0000 (18:52 -0700)
commit8c27639dbe549a58415c83a078c28e6b00c73f0f
tree6b422ad9654902c9ab5234a24222da408459754d
parent839388f39aee525db68e8ed61c966f4ba794d20d
netpoll: factor out IPv4 header setup into push_ipv4() helper

Move IPv4 header construction from netpoll_send_udp() into a new
static helper function push_ipv4(). This completes the refactoring
started with IPv6 header handling, creating symmetric helper functions
for both IP versions.

Changes include:
1. Extracting IPv4 header setup logic into push_ipv4()
2. Replacing inline IPv4 code with helper call
3. Moving eth assignment after helper calls for consistency

The refactoring reduces code duplication and improves maintainability
by isolating IP version-specific logic.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250702-netpoll_untagle_ip-v2-4-13cf3db24e2b@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/netpoll.c