aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip6_route.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r--include/net/ip6_route.h41
1 files changed, 23 insertions, 18 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 37c1a1ed82c1..5fa2af00634a 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -53,16 +53,25 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
53 return (flags >> 3) & 7; 53 return (flags >> 3) & 7;
54} 54}
55 55
56extern void rt6_bind_peer(struct rt6_info *rt, 56extern void rt6_bind_peer(struct rt6_info *rt, int create);
57 int create); 57
58static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create)
59{
60 if (rt6_has_peer(rt))
61 return rt6_peer_ptr(rt);
62
63 rt6_bind_peer(rt, create);
64 return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL);
65}
58 66
59static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) 67static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt)
60{ 68{
61 if (rt->rt6i_peer) 69 return __rt6_get_peer(rt, 0);
62 return rt->rt6i_peer; 70}
63 71
64 rt6_bind_peer(rt, 0); 72static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt)
65 return rt->rt6i_peer; 73{
74 return __rt6_get_peer(rt, 1);
66} 75}
67 76
68extern void ip6_route_input(struct sk_buff *skb); 77extern void ip6_route_input(struct sk_buff *skb);
@@ -124,17 +133,12 @@ extern int rt6_route_rcv(struct net_device *dev,
124 u8 *opt, int len, 133 u8 *opt, int len,
125 const struct in6_addr *gwaddr); 134 const struct in6_addr *gwaddr);
126 135
127extern void rt6_redirect(const struct in6_addr *dest, 136extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
128 const struct in6_addr *src, 137 int oif, u32 mark);
129 const struct in6_addr *saddr, 138extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk,
130 struct neighbour *neigh, 139 __be32 mtu);
131 u8 *lladdr, 140extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark);
132 int on_link); 141extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk);
133
134extern void rt6_pmtu_discovery(const struct in6_addr *daddr,
135 const struct in6_addr *saddr,
136 struct net_device *dev,
137 u32 pmtu);
138 142
139struct netlink_callback; 143struct netlink_callback;
140 144
@@ -154,7 +158,8 @@ extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp);
154 * Store a destination cache entry in a socket 158 * Store a destination cache entry in a socket
155 */ 159 */
156static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, 160static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
157 struct in6_addr *daddr, struct in6_addr *saddr) 161 const struct in6_addr *daddr,
162 const struct in6_addr *saddr)
158{ 163{
159 struct ipv6_pinfo *np = inet6_sk(sk); 164 struct ipv6_pinfo *np = inet6_sk(sk);
160 struct rt6_info *rt = (struct rt6_info *) dst; 165 struct rt6_info *rt = (struct rt6_info *) dst;