aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/addrconf.h
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2013-01-13 00:02:18 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-13 20:17:14 -0500
commitdaad151263cf334d57fcc0270e2483d4b4639650 (patch)
treeca0ba6274d94c1ce31a51a296a7032bb43a1cc08 /include/net/addrconf.h
parente7219858ac1f98213a4714d0e24e7a003e1bf6a2 (diff)
ipv6: Make ipv6_is_mld() inline and use it from ip6_mc_input().
Move generalized version of ipv6_is_mld() to header, and use it from ip6_mc_input(). Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/addrconf.h')
-rw-r--r--include/net/addrconf.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index df4ef9453384..7cd14c007fc5 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -150,7 +150,31 @@ extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
150extern bool ipv6_chk_mcast_addr(struct net_device *dev, 150extern bool ipv6_chk_mcast_addr(struct net_device *dev,
151 const struct in6_addr *group, 151 const struct in6_addr *group,
152 const struct in6_addr *src_addr); 152 const struct in6_addr *src_addr);
153extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr); 153
154/*
155 * identify MLD packets for MLD filter exceptions
156 */
157static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
158{
159 struct icmp6hdr *hdr;
160
161 if (nexthdr != IPPROTO_ICMPV6 ||
162 !pskb_network_may_pull(skb, offset + sizeof(struct icmp6hdr)))
163 return false;
164
165 hdr = (struct icmp6hdr *)(skb_network_header(skb) + offset);
166
167 switch (hdr->icmp6_type) {
168 case ICMPV6_MGM_QUERY:
169 case ICMPV6_MGM_REPORT:
170 case ICMPV6_MGM_REDUCTION:
171 case ICMPV6_MLD2_REPORT:
172 return true;
173 default:
174 break;
175 }
176 return false;
177}
154 178
155extern void addrconf_prefix_rcv(struct net_device *dev, 179extern void addrconf_prefix_rcv(struct net_device *dev,
156 u8 *opt, int len, bool sllao); 180 u8 *opt, int len, bool sllao);