]> git.baikalelectronics.ru Git - kernel.git/commit
net: Use fwmark reflection in PMTU discovery.
authorLorenzo Colitti <lorenzo@google.com>
Tue, 13 May 2014 17:17:34 +0000 (10:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 May 2014 22:35:09 +0000 (18:35 -0400)
commit5082e40f127daf56709af38d148a39454d6e02a2
tree60c0617f575a955b37d6c0eb681bd3f9acea8670
parentb2d88dea8bd26f1688a47b4b56612a710ef313aa
net: Use fwmark reflection in PMTU discovery.

Currently, routing lookups used for Path PMTU Discovery in
absence of a socket or on unmarked sockets use a mark of 0.
This causes PMTUD not to work when using routing based on
netfilter fwmark mangling and fwmark ip rules, such as:

  iptables -j MARK --set-mark 17
  ip rule add fwmark 17 lookup 100

This patch causes these route lookups to use the fwmark from the
received ICMP error when the fwmark_reflect sysctl is enabled.
This allows the administrator to make PMTUD work by configuring
appropriate fwmark rules to mark the inbound ICMP packets.

Black-box tested using user-mode linux by pointing different
fwmarks at routing tables egressing on different interfaces, and
using iptables mangling to mark packets inbound on each interface
with the interface's fwmark. ICMPv4 and ICMPv6 PMTU discovery
work as expected when mark reflection is enabled and fail when
it is disabled.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c
net/ipv6/route.c