There are a number of instances throughout the code where the constant 28 is
authorMatt Caswell <matt@openssl.org>
Mon, 1 Dec 2014 23:49:47 +0000 (23:49 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 3 Dec 2014 09:30:21 +0000 (09:30 +0000)
commitccecdb130c593335a9f53d5914542a98e440421d
tree24c4201fc0e33ba9e70259f76061bd9c80f3f4b4
parent80d09058af89781d7ca2b7bd064fea2615bb4e20
There are a number of instances throughout the code where the constant 28 is
used with no explanation. Some of this was introduced as part of RT#1929. The
value 28 is the length of the IP header (20 bytes) plus the UDP header (8
bytes). However use of this constant is incorrect because there may be
instances where a different value is needed, e.g. an IPv4 header is 20 bytes
but an IPv6 header is 40. Similarly you may not be using UDP (e.g. SCTP).
This commit introduces a new BIO_CTRL that provides the value to be used for
this mtu "overhead". It will be used by subsequent commits.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 0d3ae34df573f477b6b1aaf614d52dcdfcff5fce)
crypto/bio/bio.h
crypto/bio/bss_dgram.c