Index: net/tools/quic/quic_socket_utils.h |
diff --git a/net/tools/quic/quic_socket_utils.h b/net/tools/quic/quic_socket_utils.h |
index fd72697fa9c223025f1d323f309cce2457a53a04..f8cc5392c5f81fc8b1aa3868294d1f087c6fc8eb 100644 |
--- a/net/tools/quic/quic_socket_utils.h |
+++ b/net/tools/quic/quic_socket_utils.h |
@@ -38,12 +38,13 @@ class QuicSocketUtils { |
public: |
// The first integer is for overflow. The in6_pktinfo is the larger of the |
// address structures present. LinuxTimestamping is present for socket |
- // timestamping. |
+ // timestamping. The subsequent int is for ttl. |
// The final int is a sentinel so the msg_controllen feedback |
// can be used to detect larger control messages than there is space for. |
static const int kSpaceForCmsg = |
CMSG_SPACE(CMSG_LEN(sizeof(int)) + CMSG_LEN(sizeof(in6_pktinfo)) + |
CMSG_LEN(sizeof(LinuxTimestamping)) + |
+ CMSG_LEN(sizeof(int)) + |
CMSG_LEN(sizeof(int))); |
// Fills in |address| if |hdr| contains IP_PKTINFO or IPV6_PKTINFO. Fills in |
@@ -58,6 +59,10 @@ class QuicSocketUtils { |
static bool GetOverflowFromMsghdr(struct msghdr* hdr, |
QuicPacketCount* dropped_packets); |
+ // If the msghdr contains an IP_TTL entry, this will set ttl to the correct |
+ // value and return true. Otherwise it will return false. |
+ static bool GetTtlFromMsghdr(struct msghdr* hdr, int* ttl); |
+ |
// Sets either IP_PKTINFO or IPV6_PKTINFO on the socket, based on |
// address_family. Returns the return code from setsockopt. |
static int SetGetAddressInfo(int fd, int address_family); |