hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/igmp.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Linux NET3: Internet Group Management Protocol [IGMP]
34 *
....@@ -5,12 +6,6 @@
56 * Alan Cox <alan@lxorguk.ukuu.org.uk>
67 *
78 * Extended to talk the BSD extended IGMP protocol of mrouted 3.6
8
- *
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public License
12
- * as published by the Free Software Foundation; either version
13
- * 2 of the License, or (at your option) any later version.
149 */
1510 #ifndef _LINUX_IGMP_H
1611 #define _LINUX_IGMP_H
....@@ -18,6 +13,7 @@
1813 #include <linux/skbuff.h>
1914 #include <linux/timer.h>
2015 #include <linux/in.h>
16
+#include <linux/ip.h>
2117 #include <linux/refcount.h>
2218 #include <uapi/linux/igmp.h>
2319
....@@ -42,7 +38,7 @@
4238 unsigned int sl_max;
4339 unsigned int sl_count;
4440 struct rcu_head rcu;
45
- __be32 sl_addr[0];
41
+ __be32 sl_addr[];
4642 };
4743
4844 #define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \
....@@ -64,8 +60,8 @@
6460
6561 struct ip_sf_list {
6662 struct ip_sf_list *sf_next;
67
- __be32 sf_inaddr;
6863 unsigned long sf_count[2]; /* include/exclude counts */
64
+ __be32 sf_inaddr;
6965 unsigned char sf_gsresp; /* include in g & s response? */
7066 unsigned char sf_oldin; /* change state */
7167 unsigned char sf_crcount; /* retrans. left to send */
....@@ -106,6 +102,14 @@
106102 #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
107103 #define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value)
108104
105
+static inline int ip_mc_may_pull(struct sk_buff *skb, unsigned int len)
106
+{
107
+ if (skb_transport_offset(skb) + ip_transport_len(skb) < len)
108
+ return 0;
109
+
110
+ return pskb_may_pull(skb, len);
111
+}
112
+
109113 extern int ip_check_mc_rcu(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u8 proto);
110114 extern int igmp_rcv(struct sk_buff *);
111115 extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr);
....@@ -119,7 +123,7 @@
119123 extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
120124 struct ip_msfilter __user *optval, int __user *optlen);
121125 extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
122
- struct group_filter __user *optval, int __user *optlen);
126
+ struct sockaddr_storage __user *p);
123127 extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt,
124128 int dif, int sdif);
125129 extern void ip_mc_init_dev(struct in_device *);
....@@ -128,8 +132,14 @@
128132 extern void ip_mc_down(struct in_device *);
129133 extern void ip_mc_unmap(struct in_device *);
130134 extern void ip_mc_remap(struct in_device *);
131
-extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
135
+extern void __ip_mc_dec_group(struct in_device *in_dev, __be32 addr, gfp_t gfp);
136
+static inline void ip_mc_dec_group(struct in_device *in_dev, __be32 addr)
137
+{
138
+ return __ip_mc_dec_group(in_dev, addr, GFP_KERNEL);
139
+}
140
+extern void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
141
+ gfp_t gfp);
132142 extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
133
-int ip_mc_check_igmp(struct sk_buff *skb, struct sk_buff **skb_trimmed);
143
+int ip_mc_check_igmp(struct sk_buff *skb);
134144
135145 #endif