ip6_route.h (5e032e32ecc2e6cb0385dc115ca9bfe5e19a9539) ip6_route.h (8e1ef0a95b87e8b4292b2ba733e8cb854ea2d2fe)
1#ifndef _NET_IP6_ROUTE_H
2#define _NET_IP6_ROUTE_H
3
4#define IP6_RT_PRIO_FW 16
5#define IP6_RT_PRIO_USER 1024
6#define IP6_RT_PRIO_ADDRCONF 256
7#define IP6_RT_PRIO_KERN 512
8#define IP6_RT_FLOW_MASK 0x00ff

--- 130 unchanged lines hidden (view full) ---

139extern void rt6_mtu_change(struct net_device *dev, unsigned mtu);
140
141extern rwlock_t rt6_lock;
142
143/*
144 * Store a destination cache entry in a socket
145 */
146static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
1#ifndef _NET_IP6_ROUTE_H
2#define _NET_IP6_ROUTE_H
3
4#define IP6_RT_PRIO_FW 16
5#define IP6_RT_PRIO_USER 1024
6#define IP6_RT_PRIO_ADDRCONF 256
7#define IP6_RT_PRIO_KERN 512
8#define IP6_RT_FLOW_MASK 0x00ff

--- 130 unchanged lines hidden (view full) ---

139extern void rt6_mtu_change(struct net_device *dev, unsigned mtu);
140
141extern rwlock_t rt6_lock;
142
143/*
144 * Store a destination cache entry in a socket
145 */
146static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
147 struct in6_addr *daddr)
147 struct in6_addr *daddr, struct in6_addr *saddr)
148{
149 struct ipv6_pinfo *np = inet6_sk(sk);
150 struct rt6_info *rt = (struct rt6_info *) dst;
151
152 sk_setup_caps(sk, dst);
153 np->daddr_cache = daddr;
148{
149 struct ipv6_pinfo *np = inet6_sk(sk);
150 struct rt6_info *rt = (struct rt6_info *) dst;
151
152 sk_setup_caps(sk, dst);
153 np->daddr_cache = daddr;
154#ifdef CONFIG_IPV6_SUBTREES
155 np->saddr_cache = saddr;
156#endif
154 np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
155}
156
157static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
157 np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
158}
159
160static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
158 struct in6_addr *daddr)
161 struct in6_addr *daddr, struct in6_addr *saddr)
159{
160 write_lock(&sk->sk_dst_lock);
162{
163 write_lock(&sk->sk_dst_lock);
161 __ip6_dst_store(sk, dst, daddr);
164 __ip6_dst_store(sk, dst, daddr, saddr);
162 write_unlock(&sk->sk_dst_lock);
163}
164
165static inline int ipv6_unicast_destination(struct sk_buff *skb)
166{
167 struct rt6_info *rt = (struct rt6_info *) skb->dst;
168
169 return rt->rt6i_flags & RTF_LOCAL;
170}
171
172#endif
173#endif
165 write_unlock(&sk->sk_dst_lock);
166}
167
168static inline int ipv6_unicast_destination(struct sk_buff *skb)
169{
170 struct rt6_info *rt = (struct rt6_info *) skb->dst;
171
172 return rt->rt6i_flags & RTF_LOCAL;
173}
174
175#endif
176#endif