forked from quic-go/quic-go
only run DPLPMTUD if the connection can send packets with the DF bit set (#3879)
This commit is contained in:
@@ -61,11 +61,13 @@ type oobConn struct {
|
||||
// Packets received from the kernel, but not yet returned by ReadPacket().
|
||||
messages []ipv4.Message
|
||||
buffers [batchSize]*packetBuffer
|
||||
|
||||
supportsDF bool
|
||||
}
|
||||
|
||||
var _ rawConn = &oobConn{}
|
||||
|
||||
func newConn(c OOBCapablePacketConn) (*oobConn, error) {
|
||||
func newConn(c OOBCapablePacketConn, supportsDF bool) (*oobConn, error) {
|
||||
rawConn, err := c.SyscallConn()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -132,6 +134,7 @@ func newConn(c OOBCapablePacketConn) (*oobConn, error) {
|
||||
batchConn: bc,
|
||||
messages: msgs,
|
||||
readPos: batchSize,
|
||||
supportsDF: supportsDF,
|
||||
}
|
||||
for i := 0; i < batchSize; i++ {
|
||||
oobConn.messages[i].OOB = make([]byte, oobBufferSize)
|
||||
@@ -234,6 +237,10 @@ func (c *oobConn) WritePacket(b []byte, addr net.Addr, oob []byte) (n int, err e
|
||||
return n, err
|
||||
}
|
||||
|
||||
func (c *oobConn) capabilities() connCapabilities {
|
||||
return connCapabilities{DF: c.supportsDF}
|
||||
}
|
||||
|
||||
func (info *packetInfo) OOB() []byte {
|
||||
if info == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user