Go to the documentation of this file.
69 struct buffer newbuf = *buf;
146 int hlen, olen, optlen;
169 opt = (uint8_t *)(tc + 1);
171 olen -= optlen, opt += optlen)
184 if (optlen <= 0 || optlen > olen)
194 mssval = opt[2] << 8;
198 dmsg(
D_MSS,
"MSS: %" PRIu16
" -> %" PRIu16, mssval, maxmss);
199 accumulate = htons(mssval);
200 opt[2] = (uint8_t)((maxmss>>8)&0xff);
201 opt[3] = (uint8_t)(maxmss&0xff);
202 accumulate -= htons(maxmss);
260 #if defined(ENABLE_FRAGMENT)
299 size_t overhead, payload_overhead;
322 payload_overhead += 20 + 20;
362 int proto = lsi->
proto;
371 msg(
D_MTU_INFO,
"Note adjusting 'mssfix %d%s' to 'mssfix %d mtu' "
372 "according to path MTU discovery", o->
ce.
mssfix,
379 #if defined(ENABLE_FRAGMENT)
384 msg(
D_MTU_INFO,
"Note adjusting 'fragment %d%s' to 'fragment %d mtu' "
385 "according to path MTU discovery", o->
ce.
fragment,
#define OPENVPN_IPPROTO_TCP
union openvpn_sockaddr::@14 addr
Contains all state information for one tunnel.
#define OPENVPN_TCPOPT_MAXSEG
size_t frame_calculate_payload_overhead(size_t extra_tun, const struct options *options, const struct key_type *kt)
Calculates the size of the payload overhead according to tun-mtu and tap overhead.
static size_t adjust_payload_max_cbc(const struct key_type *kt, size_t target)
struct link_socket_addr * lsa
#define OPENVPN_IP_OFFMASK
struct connection_entry ce
size_t frame_calculate_protocol_header_size(const struct key_type *kt, const struct options *options, bool occ)
Calculates the size of the OpenVPN protocol header.
Packet geometry parameters.
static int clamp_size_to_int(size_t size)
unsigned short sa_family_t
#define OPENVPN_TCPOPT_NOP
static size_t round_down_size(size_t num, size_t multiple)
Rounds down num to the nearest multiple of multiple.
int cipher_kt_block_size(const char *ciphername)
Returns the block size of the cipher, in bytes.
#define ADJUST_CHECKSUM(acc, cksum)
static void frame_calculate_fragment(struct frame *frame, struct key_type *kt, const struct options *options, struct link_socket_info *lsi)
struct context_2 c2
Level 2 context.
static bool buf_advance(struct buffer *buf, int size)
#define OPENVPN_TCPOLEN_MAXSEG
#define OPENVPN_TCPOPT_EOL
int extra_tun
Maximum number of bytes in excess of the tun/tap MTU that might be read from or written to the virtua...
void mss_fixup_ipv6(struct buffer *buf, uint16_t maxmss)
void frame_calculate_dynamic(struct frame *frame, struct key_type *kt, const struct options *options, struct link_socket_info *lsi)
Set the –mssfix option.
void mss_fixup_dowork(struct buffer *buf, uint16_t maxmss)
static size_t get_ip_encap_overhead(const struct options *options, const struct link_socket_info *lsi)
struct options options
Options loaded from command line or configuration file.
#define verify_align_4(ptr)
struct frame frame_fragment
static struct link_socket_info * get_link_socket_info(struct context *c)
Wrapper structure for dynamically allocated memory.
int max_fragment_size
The maximum size of a fragment.
struct link_socket_actual actual
struct link_socket * link_socket
const char * cipher
const name of the cipher
void mss_fixup_ipv4(struct buffer *buf, uint16_t maxmss)
uint16_t mss_fix
The actual MSS value that should be written to the payload packets.
unsigned int calc_packet_id_size_dc(const struct options *options, const struct key_type *kt)
Return the size of the packet ID size that is currently in use by cipher and options for the data cha...
bool cipher_kt_mode_cbc(const char *ciphername)
Check if the supplied cipher is a supported CBC mode cipher.
#define OPENVPN_TCPH_GET_DOFF(d)
#define OPENVPN_TCPH_SYN_MASK
static int datagram_overhead(sa_family_t af, int proto)
static void frame_calculate_mssfix(struct frame *frame, struct key_type *kt, const struct options *options, struct link_socket_info *lsi)
struct openvpn_sockaddr dest
#define OPENVPN_IPH_GET_LEN(v)
void frame_adjust_path_mtu(struct context *c)
Checks and adjusts the fragment and mssfix value according to the discovered path mtu value.
struct context_1 c1
Level 1 context.