|
@@ -583,6 +583,11 @@ static inline bool ipv6_addr_orchid(const struct in6_addr *a)
|
|
return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010);
|
|
return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline bool ipv6_addr_is_multicast(const struct in6_addr *addr)
|
|
|
|
+{
|
|
|
|
+ return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
|
|
|
|
+}
|
|
|
|
+
|
|
static inline void ipv6_addr_set_v4mapped(const __be32 addr,
|
|
static inline void ipv6_addr_set_v4mapped(const __be32 addr,
|
|
struct in6_addr *v4mapped)
|
|
struct in6_addr *v4mapped)
|
|
{
|
|
{
|
|
@@ -664,6 +669,20 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
|
|
|
|
|
|
int ip6_dst_hoplimit(struct dst_entry *dst);
|
|
int ip6_dst_hoplimit(struct dst_entry *dst);
|
|
|
|
|
|
|
|
+static inline int ip6_sk_dst_hoplimit(struct ipv6_pinfo *np, struct flowi6 *fl6,
|
|
|
|
+ struct dst_entry *dst)
|
|
|
|
+{
|
|
|
|
+ int hlimit;
|
|
|
|
+
|
|
|
|
+ if (ipv6_addr_is_multicast(&fl6->daddr))
|
|
|
|
+ hlimit = np->mcast_hops;
|
|
|
|
+ else
|
|
|
|
+ hlimit = np->hop_limit;
|
|
|
|
+ if (hlimit < 0)
|
|
|
|
+ hlimit = ip6_dst_hoplimit(dst);
|
|
|
|
+ return hlimit;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Header manipulation
|
|
* Header manipulation
|
|
*/
|
|
*/
|