diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2013-12-14 21:41:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-18 17:37:05 -0500 |
commit | 93b36cf3425b9bd9c56df7680fb237686b9c82ae (patch) | |
tree | 1562e2899394e011e22ce21523dd6ce1defc3ee8 /include/net | |
parent | cd174e67a6b312fce9bab502ba2b0583e11f537f (diff) |
ipv6: support IPV6_PMTU_INTERFACE on sockets
IPV6_PMTU_INTERFACE is the same as IPV6_PMTU_PROBE for ipv6. Add it
nontheless for symmetry with IPv4 sockets. Also drop incoming MTU
information if this mode is enabled.
The additional bit in ipv6_pinfo just eats in the padding behind the
bitfield. There are no changes to the layout of the struct at all.
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip6_route.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 733747ce163c..c2626ce1f2ad 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -178,10 +178,15 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | |||
178 | { | 178 | { |
179 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | 179 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; |
180 | 180 | ||
181 | return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? | 181 | return (np && np->pmtudisc >= IPV6_PMTUDISC_PROBE) ? |
182 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 182 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); |
183 | } | 183 | } |
184 | 184 | ||
185 | static inline bool ip6_sk_accept_pmtu(const struct sock *sk) | ||
186 | { | ||
187 | return inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_INTERFACE; | ||
188 | } | ||
189 | |||
185 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) | 190 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) |
186 | { | 191 | { |
187 | return &rt->rt6i_gateway; | 192 | return &rt->rt6i_gateway; |