diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2013-12-13 23:13:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-18 16:58:20 -0500 |
commit | cd174e67a6b312fce9bab502ba2b0583e11f537f (patch) | |
tree | 992dc562f0562abdf9d549c1d06725f001270570 | |
parent | 974eda11c54290a1be8f8b155edae7d791e5ce57 (diff) |
ipv4: new ip_no_pmtu_disc mode to always discard incoming frag needed msgs
This new mode discards all incoming fragmentation-needed notifications
as I guess was originally intended with this knob. To not break backward
compatibility too much, I only added a special case for mode 2 in the
receiving path.
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/networking/ip-sysctl.txt | 10 | ||||
-rw-r--r-- | net/ipv4/icmp.c | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index f76d177895d9..d71afa8bd828 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -15,12 +15,18 @@ ip_default_ttl - INTEGER | |||
15 | forwarded) IP packets. Should be between 1 and 255 inclusive. | 15 | forwarded) IP packets. Should be between 1 and 255 inclusive. |
16 | Default: 64 (as recommended by RFC1700) | 16 | Default: 64 (as recommended by RFC1700) |
17 | 17 | ||
18 | ip_no_pmtu_disc - BOOLEAN | 18 | ip_no_pmtu_disc - INTEGER |
19 | Disable Path MTU Discovery. If enabled and a | 19 | Disable Path MTU Discovery. If enabled in mode 1 and a |
20 | fragmentation-required ICMP is received, the PMTU to this | 20 | fragmentation-required ICMP is received, the PMTU to this |
21 | destination will be set to min_pmtu (see below). You will need | 21 | destination will be set to min_pmtu (see below). You will need |
22 | to raise min_pmtu to the smallest interface MTU on your system | 22 | to raise min_pmtu to the smallest interface MTU on your system |
23 | manually if you want to avoid locally generated fragments. | 23 | manually if you want to avoid locally generated fragments. |
24 | |||
25 | In mode 2 incoming Path MTU Discovery messages will be | ||
26 | discarded. Outgoing frames are handled the same as in mode 1, | ||
27 | implicitly setting IP_PMTUDISC_DONT on every created socket. | ||
28 | |||
29 | Possible values: 0-2 | ||
24 | Default: FALSE | 30 | Default: FALSE |
25 | 31 | ||
26 | min_pmtu - INTEGER | 32 | min_pmtu - INTEGER |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 1a4ee84ca3f3..fb3c5637199d 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -705,7 +705,9 @@ static void icmp_unreach(struct sk_buff *skb) | |||
705 | case ICMP_PORT_UNREACH: | 705 | case ICMP_PORT_UNREACH: |
706 | break; | 706 | break; |
707 | case ICMP_FRAG_NEEDED: | 707 | case ICMP_FRAG_NEEDED: |
708 | if (net->ipv4.sysctl_ip_no_pmtu_disc) { | 708 | if (net->ipv4.sysctl_ip_no_pmtu_disc == 2) { |
709 | goto out; | ||
710 | } else if (net->ipv4.sysctl_ip_no_pmtu_disc) { | ||
709 | LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: fragmentation needed and DF set\n"), | 711 | LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: fragmentation needed and DF set\n"), |
710 | &iph->daddr); | 712 | &iph->daddr); |
711 | } else { | 713 | } else { |