aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2014-02-25 19:20:43 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-26 15:51:01 -0500
commit0b95227a7ba7e69f795757cd7c839eff0615f2d1 (patch)
treec7e343f11b05e29cf4d9ccc4b2026f0002fd78f7 /net/ipv6
parent1b346576359c72bee34b1476b4fc63d77d37b314 (diff)
ipv6: yet another new IPV6_MTU_DISCOVER option IPV6_PMTUDISC_OMIT
This option has the same semantic as IP_PMTUDISC_OMIT for IPv4 which got recently introduced. It doesn't honor the path mtu discovered by the host but in contrary to IPV6_PMTUDISC_INTERFACE allows the generation of fragments if the packet size exceeds the MTU of the outgoing interface MTU. Fixes: 93b36cf3425b9b ("ipv6: support IPV6_PMTU_INTERFACE on sockets") Cc: Florian Weimer <fweimer@redhat.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_output.c9
-rw-r--r--net/ipv6/ipv6_sockglue.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 070a2fae2375..be1b7f5a3a54 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1234,8 +1234,10 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1234 sizeof(struct frag_hdr) : 0) + 1234 sizeof(struct frag_hdr) : 0) +
1235 rt->rt6i_nfheader_len; 1235 rt->rt6i_nfheader_len;
1236 1236
1237 maxnonfragsize = (np->pmtudisc >= IPV6_PMTUDISC_DO) ? 1237 if (ip6_sk_local_df(sk))
1238 mtu : sizeof(struct ipv6hdr) + IPV6_MAXPLEN; 1238 maxnonfragsize = sizeof(struct ipv6hdr) + IPV6_MAXPLEN;
1239 else
1240 maxnonfragsize = mtu;
1239 1241
1240 /* dontfrag active */ 1242 /* dontfrag active */
1241 if ((cork->length + length > mtu - headersize) && dontfrag && 1243 if ((cork->length + length > mtu - headersize) && dontfrag &&
@@ -1543,8 +1545,7 @@ int ip6_push_pending_frames(struct sock *sk)
1543 } 1545 }
1544 1546
1545 /* Allow local fragmentation. */ 1547 /* Allow local fragmentation. */
1546 if (np->pmtudisc < IPV6_PMTUDISC_DO) 1548 skb->local_df = ip6_sk_local_df(sk);
1547 skb->local_df = 1;
1548 1549
1549 *final_dst = fl6->daddr; 1550 *final_dst = fl6->daddr;
1550 __skb_pull(skb, skb_network_header_len(skb)); 1551 __skb_pull(skb, skb_network_header_len(skb));
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 0a00f449de5e..edb58aff4ae7 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -722,7 +722,7 @@ done:
722 case IPV6_MTU_DISCOVER: 722 case IPV6_MTU_DISCOVER:
723 if (optlen < sizeof(int)) 723 if (optlen < sizeof(int))
724 goto e_inval; 724 goto e_inval;
725 if (val < IPV6_PMTUDISC_DONT || val > IPV6_PMTUDISC_INTERFACE) 725 if (val < IPV6_PMTUDISC_DONT || val > IPV6_PMTUDISC_OMIT)
726 goto e_inval; 726 goto e_inval;
727 np->pmtudisc = val; 727 np->pmtudisc = val;
728 retv = 0; 728 retv = 0;