aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 25476e7e708b..17e217933885 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -670,7 +670,7 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort, struct in6_addr *dad
670 670
671 if (net_ratelimit()) 671 if (net_ratelimit())
672 printk(KERN_WARNING 672 printk(KERN_WARNING
673 "Neighbour table overflow.\n"); 673 "ipv6: Neighbour table overflow.\n");
674 dst_free(&rt->dst); 674 dst_free(&rt->dst);
675 return NULL; 675 return NULL;
676 } 676 }
@@ -1559,14 +1559,13 @@ out:
1559 * i.e. Path MTU discovery 1559 * i.e. Path MTU discovery
1560 */ 1560 */
1561 1561
1562void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr, 1562static void rt6_do_pmtu_disc(struct in6_addr *daddr, struct in6_addr *saddr,
1563 struct net_device *dev, u32 pmtu) 1563 struct net *net, u32 pmtu, int ifindex)
1564{ 1564{
1565 struct rt6_info *rt, *nrt; 1565 struct rt6_info *rt, *nrt;
1566 struct net *net = dev_net(dev);
1567 int allfrag = 0; 1566 int allfrag = 0;
1568 1567
1569 rt = rt6_lookup(net, daddr, saddr, dev->ifindex, 0); 1568 rt = rt6_lookup(net, daddr, saddr, ifindex, 0);
1570 if (rt == NULL) 1569 if (rt == NULL)
1571 return; 1570 return;
1572 1571
@@ -1634,6 +1633,27 @@ out:
1634 dst_release(&rt->dst); 1633 dst_release(&rt->dst);
1635} 1634}
1636 1635
1636void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
1637 struct net_device *dev, u32 pmtu)
1638{
1639 struct net *net = dev_net(dev);
1640
1641 /*
1642 * RFC 1981 states that a node "MUST reduce the size of the packets it
1643 * is sending along the path" that caused the Packet Too Big message.
1644 * Since it's not possible in the general case to determine which
1645 * interface was used to send the original packet, we update the MTU
1646 * on the interface that will be used to send future packets. We also
1647 * update the MTU on the interface that received the Packet Too Big in
1648 * case the original packet was forced out that interface with
1649 * SO_BINDTODEVICE or similar. This is the next best thing to the
1650 * correct behaviour, which would be to update the MTU on all
1651 * interfaces.
1652 */
1653 rt6_do_pmtu_disc(daddr, saddr, net, pmtu, 0);
1654 rt6_do_pmtu_disc(daddr, saddr, net, pmtu, dev->ifindex);
1655}
1656
1637/* 1657/*
1638 * Misc support functions 1658 * Misc support functions
1639 */ 1659 */