mirror of
https://passt.top/passt
synced 2025-02-22 02:42:22 +00:00
tap: always set the no_frag flag in IPv4 headers
When studying the Linux source code and Wireshark dumps it seems like the no_frag flag in the IPv4 header is always set. Following discussions in the Internet on this subject indicates that modern routers never fragment packets, and that it isn't even supported in many cases. Adding to this that incoming messages forwarded on the tap interface never even pass through a router it seems safe to always set this flag. This makes the IPv4 headers of forwarded messages identical to those sent by the external sockets, something we must consider desirable. Signed-off-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
4dac2351fa
commit
ea69ca6a20
3
ip.h
3
ip.h
@ -36,13 +36,14 @@
|
||||
.tos = 0, \
|
||||
.tot_len = 0, \
|
||||
.id = 0, \
|
||||
.frag_off = 0, \
|
||||
.frag_off = htons(IP_DF), \
|
||||
.ttl = 0xff, \
|
||||
.protocol = (proto), \
|
||||
.saddr = 0, \
|
||||
.daddr = 0, \
|
||||
}
|
||||
#define L2_BUF_IP4_PSUM(proto) ((uint32_t)htons_constant(0x4500) + \
|
||||
(uint32_t)htons_constant(IP_DF) + \
|
||||
(uint32_t)htons(0xff00 | (proto)))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user