hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/include/net/raw.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,16 +9,11 @@
89 * Version: @(#)raw.h 1.0.2 05/07/93
910 *
1011 * Author: 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 _RAW_H
1814 #define _RAW_H
1915
20
-
16
+#include <net/inet_sock.h>
2117 #include <net/protocol.h>
2218 #include <linux/icmp.h>
2319
....@@ -61,6 +57,7 @@
6157
6258 int raw_hash_sk(struct sock *sk);
6359 void raw_unhash_sk(struct sock *sk);
60
+void raw_init(void);
6461
6562 struct raw_sock {
6663 /* inet_sock has to be the first member */
....@@ -74,4 +71,15 @@
7471 return (struct raw_sock *)sk;
7572 }
7673
74
+static inline bool raw_sk_bound_dev_eq(struct net *net, int bound_dev_if,
75
+ int dif, int sdif)
76
+{
77
+#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
78
+ return inet_bound_dev_eq(READ_ONCE(net->ipv4.sysctl_raw_l3mdev_accept),
79
+ bound_dev_if, dif, sdif);
80
+#else
81
+ return inet_bound_dev_eq(true, bound_dev_if, dif, sdif);
82
+#endif
83
+}
84
+
7785 #endif /* _RAW_H */