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 | |
| 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')
| -rw-r--r-- | include/linux/ipv6.h | 2 | ||||
| -rw-r--r-- | include/net/ip6_route.h | 7 | ||||
| -rw-r--r-- | include/uapi/linux/in6.h | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 3fde06645553..7e1ded0d8e45 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -191,7 +191,7 @@ struct ipv6_pinfo { | |||
| 191 | /* sockopt flags */ | 191 | /* sockopt flags */ |
| 192 | __u16 recverr:1, | 192 | __u16 recverr:1, |
| 193 | sndflow:1, | 193 | sndflow:1, |
| 194 | pmtudisc:2, | 194 | pmtudisc:3, |
| 195 | ipv6only:1, | 195 | ipv6only:1, |
| 196 | srcprefs:3, /* 001: prefer temporary address | 196 | srcprefs:3, /* 001: prefer temporary address |
| 197 | * 010: prefer public address | 197 | * 010: prefer public address |
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; |
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h index 440d5c479145..f94f1d013bf2 100644 --- a/include/uapi/linux/in6.h +++ b/include/uapi/linux/in6.h | |||
| @@ -188,6 +188,10 @@ enum { | |||
| 188 | #define IPV6_PMTUDISC_WANT 1 | 188 | #define IPV6_PMTUDISC_WANT 1 |
| 189 | #define IPV6_PMTUDISC_DO 2 | 189 | #define IPV6_PMTUDISC_DO 2 |
| 190 | #define IPV6_PMTUDISC_PROBE 3 | 190 | #define IPV6_PMTUDISC_PROBE 3 |
| 191 | /* same as IPV6_PMTUDISC_PROBE, provided for symetry with IPv4 | ||
| 192 | * also see comments on IP_PMTUDISC_INTERFACE | ||
| 193 | */ | ||
| 194 | #define IPV6_PMTUDISC_INTERFACE 4 | ||
| 191 | 195 | ||
| 192 | /* Flowlabel */ | 196 | /* Flowlabel */ |
| 193 | #define IPV6_FLOWLABEL_MGR 32 | 197 | #define IPV6_FLOWLABEL_MGR 32 |
