Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806762/?format=api
{ "id": 806762, "url": "http://patchwork.ozlabs.org/api/patches/806762/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1503953614-32395-1-git-send-email-dsahern@gmail.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1503953614-32395-1-git-send-email-dsahern@gmail.com>", "list_archive_url": null, "date": "2017-08-28T20:53:34", "name": "[net-next] ipv6: Use rt6i_idev index for echo replies to a local address", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "31f90ef5c7cfef04e35454a89ab6e2320e9259ab", "submitter": { "id": 6918, "url": "http://patchwork.ozlabs.org/api/people/6918/?format=api", "name": "David Ahern", "email": "dsahern@gmail.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1503953614-32395-1-git-send-email-dsahern@gmail.com/mbox/", "series": [ { "id": 256, "url": "http://patchwork.ozlabs.org/api/series/256/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=256", "date": "2017-08-28T20:53:34", "name": "[net-next] ipv6: Use rt6i_idev index for echo replies to a local address", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/256/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806762/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806762/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"TwzNeJLM\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xh3sD1tXnz9sN5\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 06:53:49 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751208AbdH1Uxq (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 16:53:46 -0400", "from mail-pg0-f68.google.com ([74.125.83.68]:37988 \"EHLO\n\tmail-pg0-f68.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750735AbdH1Uxp (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 28 Aug 2017 16:53:45 -0400", "by mail-pg0-f68.google.com with SMTP id t3so1154549pgt.5\n\tfor <netdev@vger.kernel.org>; Mon, 28 Aug 2017 13:53:45 -0700 (PDT)", "from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com.\n\t[216.129.126.126]) by smtp.googlemail.com with ESMTPSA id\n\ta15sm2006036pfl.1.2017.08.28.13.53.43\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 28 Aug 2017 13:53:43 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=iK/WNJObxEpebeceDd6TVadnRswTif4IlAQ8kneytVY=;\n\tb=TwzNeJLMshnEcjkLPqLnCbh8xnKGHYHbG0wjp+CWMbRgtuQD465ND6/b50HzeE5YHa\n\tftGMrXbO8lOnXMNllbRFE0NNIGvGypM5fQGVSIHFpNIHTI1RGXnYBZTpoOyfMJe3eatU\n\t9uYzIoMV2hEcRu6RpY2xDE4WtTKkvvykhEoNFnwq44oteTWdSa1TAQn5lCcVeDt0UfK8\n\tFYeXDVRh4GuPCH0S7wOfIE1Hm3Xt8deftxagmHn3fUTvkypHzw8SxXxXPEbHqFKUxqQA\n\tR49RUQEJbaS3Pzkc74ag7YSmUdw9DT5gG9yObch9OdqlsRB0fn6XwO0P9Co+sBIEhGJI\n\tsarQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=iK/WNJObxEpebeceDd6TVadnRswTif4IlAQ8kneytVY=;\n\tb=kt4M6imOGAMuo2KvScXjovSR8XL7rtvZF9dvma/T9IaDlaclKPP6qNowKu0n2DkhNF\n\tscESHxD0eZLBt4VX+oYjtJkowX3ywBIvqJPFE9jZHwi4xY5efjVuErI5y33GSXrncEGb\n\tyMTx0j53dg1C1maGCz1Fv0kKZGPvcrLUnwxU0B/GnW7xngVQJttt+04l4eSjxDM2gGSQ\n\tQ47lMYX0vBiYLmLDvvLygJu71XIaEusn7AG0ghUO4Yg6FkppX04PL7uVuk/W4S8frBWN\n\tg1wO3w2Hv+SFuiJl27aXmULzz64EvBoCGowoVMU4P2YPUuvo/tzdH4eSG8kVBNolJPoS\n\tlCcQ==", "X-Gm-Message-State": "AHYfb5hPIePL4Mi94rO+m1w5Do4gPOX4E3bcN9m3DL78Q2bi1MoN0PHj\n\truozWRj41H/wAO7j", "X-Received": "by 10.84.225.19 with SMTP id t19mr2231179plj.287.1503953624477; \n\tMon, 28 Aug 2017 13:53:44 -0700 (PDT)", "From": "David Ahern <dsahern@gmail.com>", "To": "netdev@vger.kernel.org, tariqt@mellanox.com", "Cc": "David Ahern <dsahern@gmail.com>", "Subject": "[PATCH net-next] ipv6: Use rt6i_idev index for echo replies to a\n\tlocal address", "Date": "Mon, 28 Aug 2017 13:53:34 -0700", "Message-Id": "<1503953614-32395-1-git-send-email-dsahern@gmail.com>", "X-Mailer": "git-send-email 2.1.4", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Tariq repored local pings to linklocal address is failing:\n$ ifconfig ens8\nens8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500\n inet 11.141.16.6 netmask 255.255.0.0 broadcast 11.141.255.255\n inet6 fe80::7efe:90ff:fecb:7502 prefixlen 64 scopeid 0x20<link>\n ether 7c:fe:90:cb:75:02 txqueuelen 1000 (Ethernet)\n RX packets 12 bytes 1164 (1.1 KiB)\n RX errors 0 dropped 0 overruns 0 frame 0\n TX packets 30 bytes 2484 (2.4 KiB)\n TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0\n\n$ /bin/ping6 -c 3 fe80::7efe:90ff:fecb:7502%ens8\nPING fe80::7efe:90ff:fecb:7502%ens8(fe80::7efe:90ff:fecb:7502) 56 data bytes\n\n--- fe80::7efe:90ff:fecb:7502%ens8 ping statistics ---\n3 packets transmitted, 0 received, 100% packet loss, time 2043ms\n\nicmpv6_echo_reply needs to use the rt6i_idev dev index for local traffic\nsimilar to how icmp6_send does. Convert the change for icmp6_send into a\nhelper that can be used in both places. Add the long over due\nskb_rt6_info helper to convert dst on an skb to rt6_info similar to\nskb_rtable for ipv4.\n\nFixes: 4832c30d5458 (\"net: ipv6: put host and anycast routes on\n device with address\")\nReported-by: Tariq Toukan <tariqt@mellanox.com>\nSigned-off-by: David Ahern <dsahern@gmail.com>\n---\n include/net/ip6_route.h | 10 ++++++++++\n net/ipv6/icmp.c | 33 ++++++++++++++++++++-------------\n 2 files changed, 30 insertions(+), 13 deletions(-)", "diff": "diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h\nindex 882bc3c7ccde..ee96f402cb75 100644\n--- a/include/net/ip6_route.h\n+++ b/include/net/ip6_route.h\n@@ -164,6 +164,16 @@ void rt6_mtu_change(struct net_device *dev, unsigned int mtu);\n void rt6_remove_prefsrc(struct inet6_ifaddr *ifp);\n void rt6_clean_tohost(struct net *net, struct in6_addr *gateway);\n \n+static inline const struct rt6_info *skb_rt6_info(const struct sk_buff *skb)\n+{\n+\tconst struct dst_entry *dst = skb_dst(skb);\n+\tconst struct rt6_info *rt6 = NULL;\n+\n+\tif (dst)\n+\t\trt6 = container_of(dst, struct rt6_info, dst);\n+\n+\treturn rt6;\n+}\n \n /*\n *\tStore a destination cache entry in a socket\ndiff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c\nindex dd7608cf1d72..c25b5954cfbb 100644\n--- a/net/ipv6/icmp.c\n+++ b/net/ipv6/icmp.c\n@@ -399,6 +399,24 @@ static struct dst_entry *icmpv6_route_lookup(struct net *net,\n \treturn ERR_PTR(err);\n }\n \n+static int icmp6_iif(const struct sk_buff *skb)\n+{\n+\tint iif = skb->dev->ifindex;\n+\n+\t/* for local traffic to local address, skb dev is the loopback\n+\t * device. Check if there is a dst attached to the skb and if so\n+\t * get the real device index.\n+\t */\n+\tif (unlikely(iif == LOOPBACK_IFINDEX)) {\n+\t\tconst struct rt6_info *rt6 = skb_rt6_info(skb);\n+\n+\t\tif (rt6)\n+\t\t\tiif = rt6->rt6i_idev->dev->ifindex;\n+\t}\n+\n+\treturn iif;\n+}\n+\n /*\n *\tSend an ICMP message in response to a packet in error\n */\n@@ -460,18 +478,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,\n \t */\n \n \tif (__ipv6_addr_needs_scope_id(addr_type)) {\n-\t\tiif = skb->dev->ifindex;\n-\n-\t\t/* for local packets, get the real device index */\n-\t\tif (iif == LOOPBACK_IFINDEX) {\n-\t\t\tdst = skb_dst(skb);\n-\t\t\tif (dst) {\n-\t\t\t\tstruct rt6_info *rt;\n-\n-\t\t\t\trt = container_of(dst, struct rt6_info, dst);\n-\t\t\t\tiif = rt->rt6i_idev->dev->ifindex;\n-\t\t\t}\n-\t\t}\n+\t\tiif = icmp6_iif(skb);\n \t} else {\n \t\tdst = skb_dst(skb);\n \t\tiif = l3mdev_master_ifindex(dst ? dst->dev : skb->dev);\n@@ -694,7 +701,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)\n \tfl6.daddr = ipv6_hdr(skb)->saddr;\n \tif (saddr)\n \t\tfl6.saddr = *saddr;\n-\tfl6.flowi6_oif = skb->dev->ifindex;\n+\tfl6.flowi6_oif = icmp6_iif(skb);\n \tfl6.fl6_icmp_type = ICMPV6_ECHO_REPLY;\n \tfl6.flowi6_mark = mark;\n \tfl6.flowi6_uid = sock_net_uid(net, NULL);\n", "prefixes": [ "net-next" ] }