[PATCH trivial 0/3] tcp_vu: Remove redundant header field assignments
tcp_vu_send_flag() and tcp_vu_prepare() set several header fields that are unconditionally overwritten by tcp_fill_headers() or tcp_prepare_flags() shortly after. This series removes: 1. eh->h_proto assignments in both tcp_vu_send_flag() and tcp_vu_prepare(), overwritten by tcp_fill_headers() 2. eh->h_source memcpy in tcp_vu_send_flag(), overwritten by eth_update_mac() called from tcp_fill_headers() 3. th->doff and th->ack assignments in tcp_vu_send_flag(), overwritten by tcp_prepare_flags() Laurent Vivier (3): tcp_vu: Remove redundant eh->h_proto assignments tcp_vu: Remove redundant eh->h_source assignment in tcp_vu_send_flag() tcp_vu: Remove redundant th->doff and th->ack in tcp_vu_send_flag() tcp_vu.c | 11 ----------- 1 file changed, 11 deletions(-) -- 2.53.0
tcp_fill_headers() unconditionally sets eh->h_proto based on whether
ip4h or ip6h is non-NULL. The assignments in tcp_vu_send_flag() and
tcp_vu_prepare() are therefore redundant and can be removed.
Signed-off-by: Laurent Vivier
tcp_fill_headers() calls eth_update_mac(eh, NULL, omac) which
unconditionally overwrites eh->h_source. The prior memcpy() setting
it to c->our_tap_mac is therefore redundant.
Signed-off-by: Laurent Vivier
tcp_prepare_flags() unconditionally sets th->doff and th->ack, so
setting them right after the memset() is redundant.
Signed-off-by: Laurent Vivier
participants (1)
-
Laurent Vivier