diff options
| author | R. Parameswaran <parameswaran.r7@gmail.com> | 2020-05-22 00:39:19 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-27 16:41:54 +0200 |
| commit | b25415f9f0d539c587a80a608c3e2211f1c079af (patch) | |
| tree | c272e7262c827b0ffcf59efa5f4dd197ccf7f72a /include | |
| parent | 6df792e20933d5ef670457d67a6bb9f497344bcf (diff) | |
| download | linux-b25415f9f0d539c587a80a608c3e2211f1c079af.tar.gz linux-b25415f9f0d539c587a80a608c3e2211f1c079af.tar.bz2 linux-b25415f9f0d539c587a80a608c3e2211f1c079af.zip | |
New kernel function to get IP overhead on a socket.
commit 113c3075931a334f899008f6c753abe70a3a9323 upstream.
A new function, kernel_sock_ip_overhead(), is provided
to calculate the cumulative overhead imposed by the IP
Header and IP options, if any, on a socket's payload.
The new function returns an overhead of zero for sockets
that do not belong to the IPv4 or IPv6 address families.
This is used in the L2TP code path to compute the
total outer IP overhead on the L2TP tunnel socket when
calculating the default MTU for Ethernet pseudowires.
Signed-off-by: R. Parameswaran <rparames@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/net.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index cd0c8bd0a1de..2c8b092f3f17 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -298,6 +298,9 @@ int kernel_sendpage(struct socket *sock, struct page *page, int offset, int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how); +/* Following routine returns the IP overhead imposed by a socket. */ +u32 kernel_sock_ip_overhead(struct sock *sk); + #define MODULE_ALIAS_NETPROTO(proto) \ MODULE_ALIAS("net-pf-" __stringify(proto)) |
