New kernel function to get IP overhead on a socket.
authorR. Parameswaran <parameswaran.r7@gmail.com>
Thu, 21 May 2020 23:39:19 +0000 (00:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 14:41:54 +0000 (16:41 +0200)
commitb25415f9f0d539c587a80a608c3e2211f1c079af
treec272e7262c827b0ffcf59efa5f4dd197ccf7f72a
parent6df792e20933d5ef670457d67a6bb9f497344bcf
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>
include/linux/net.h
net/socket.c