hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/ip.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * INET An implementation of the TCP/IP protocol suite for the LINUX
34 * operating system. INET is implemented using the BSD Socket
....@@ -8,11 +9,6 @@
89 * Version: @(#)ip.h 1.0.2 04/28/93
910 *
1011 * Authors: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11
- *
12
- * This program is free software; you can redistribute it and/or
13
- * modify it under the terms of the GNU General Public License
14
- * as published by the Free Software Foundation; either version
15
- * 2 of the License, or (at your option) any later version.
1612 */
1713 #ifndef _LINUX_IP_H
1814 #define _LINUX_IP_H
....@@ -34,4 +30,9 @@
3430 {
3531 return (struct iphdr *)skb_transport_header(skb);
3632 }
33
+
34
+static inline unsigned int ip_transport_len(const struct sk_buff *skb)
35
+{
36
+ return ntohs(ip_hdr(skb)->tot_len) - skb_network_header_len(skb);
37
+}
3738 #endif /* _LINUX_IP_H */