Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807511/?format=api
{ "id": 807511, "url": "http://patchwork.ozlabs.org/api/patches/807511/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1504083037-1605-1-git-send-email-amsalam20@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": "<1504083037-1605-1-git-send-email-amsalam20@gmail.com>", "list_archive_url": null, "date": "2017-08-30T08:50:37", "name": "[v2] ipv6: sr: fix get_srh() to comply with IPv6 standard \"RFC 8200\"", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "c6482ead979f8494b49a4d335c1196a7a6517c38", "submitter": { "id": 72243, "url": "http://patchwork.ozlabs.org/api/people/72243/?format=api", "name": "Ahmed Abdelsalam", "email": "amsalam20@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/1504083037-1605-1-git-send-email-amsalam20@gmail.com/mbox/", "series": [ { "id": 554, "url": "http://patchwork.ozlabs.org/api/series/554/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=554", "date": "2017-08-30T08:50:37", "name": "[v2] ipv6: sr: fix get_srh() to comply with IPv6 standard \"RFC 8200\"", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/554/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807511/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807511/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=\"jQmx9Jj0\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhzkQ5gdhz9t2Q\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 18:51:10 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751875AbdH3IvI (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 30 Aug 2017 04:51:08 -0400", "from mail-wr0-f194.google.com ([209.85.128.194]:35953 \"EHLO\n\tmail-wr0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751368AbdH3IvH (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 30 Aug 2017 04:51:07 -0400", "by mail-wr0-f194.google.com with SMTP id 40so3519172wrv.3\n\tfor <netdev@vger.kernel.org>; Wed, 30 Aug 2017 01:51:06 -0700 (PDT)", "from kernel-dev.cisco.com ([173.38.220.45])\n\tby smtp.gmail.com with ESMTPSA id\n\tk64sm4853829wrc.91.2017.08.30.01.51.04\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 30 Aug 2017 01:51:04 -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=fRNqCjePQ12mvrd7xABqsPZ86OuRxEk9yveFmiazf7c=;\n\tb=jQmx9Jj0Fv64cHgXyOIkvYRzyUKuUnmYNhxY9q/JQyZd5BAgLaX6ZwRl4cKp4DBGG+\n\ttIwGIHZu/pMw5YmKB0R88DmvL+FRodhI3mm07HKtEtify8cEBVHF8UzTtsEC+RtgAVX1\n\taMZSp8Gem7BSK+pZ4OU591XjvKo0a5eKYmug8Ou2CTVtwfKxqd2h4CXPJx0VvlxIve84\n\tJV9qqRlUTUh7F9hG/h7yzaLE6cWj9p5uj1NXu2BPVCJlGaB7jDWd0QWQvxYppq1wIcV0\n\tBCJEkOGGgjhwQg3kayxdhY8fxNLdcO3K8jNRHltJfpU4XMWDJq/wmusCYH6oPObeMePs\n\tdsYQ==", "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=fRNqCjePQ12mvrd7xABqsPZ86OuRxEk9yveFmiazf7c=;\n\tb=uKOgTwlaXMwE4TzBNuKf3l94XxWItRB0k5hAUlq/dj0tvbDkyCF5LXBarHrQ2HiopJ\n\tchd4G2SAhVWXomlibrN2v4x5xK27tusvT6QKr0W4Fhue3AfhjJzAu7CTFHIqgOgYNqI5\n\tttepvEa0ELSkEBtJ7zfAWVb7CrAAbbmLmLah8k6g6AGl1MUGf84indVVrC5OfK26BhGK\n\tgzPU3k5K1m+qHveFIvV1eP0NM6J9DGV1PD1zsjYyX1sKt5KSmDMX/IvCmEdr2yum0kSZ\n\tZCwmhbADSRpSePKU7ySDkV667Voz1IzZrXJ07MNg7iWrcFRhOpyaPCoBmb1NQkEKhO9V\n\tB2+Q==", "X-Gm-Message-State": "AHYfb5h+SexnnvpDsxb2UhHD6yzSHdX5u5BxQ3hKKVpztJyedGH93A2d\n\thO0q8GHUwYlpSw==", "X-Received": "by 10.223.143.4 with SMTP id p4mr593111wrb.29.1504083065588;\n\tWed, 30 Aug 2017 01:51:05 -0700 (PDT)", "From": "Ahmed Abdelsalam <amsalam20@gmail.com>", "To": "davem@davemloft.net", "Cc": "netdev@vger.kernel.org, david.lebrun@uclouvain.be, amsalam20@gmail.com", "Subject": "[PATCH v2] ipv6: sr: fix get_srh() to comply with IPv6 standard\n\t\"RFC 8200\"", "Date": "Wed, 30 Aug 2017 10:50:37 +0200", "Message-Id": "<1504083037-1605-1-git-send-email-amsalam20@gmail.com>", "X-Mailer": "git-send-email 2.7.4", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "IPv6 packet may carry more than one extension header, and IPv6 nodes must\naccept and attempt to process extension headers in any order and occurring\nany number of times in the same packet. Hence, there should be no\nassumption that Segment Routing extension header is to appear immediately\nafter the IPv6 header.\n\nMoreover, section 4.1 of RFC 8200 gives a recommendation on the order of\nappearance of those extension headers within an IPv6 packet. According to\nthis recommendation, Segment Routing extension header should appear after\nHop-by-Hop and Destination Options headers (if they present).\n\nThis patch fixes the get_srh(), so it gets the segment routing header\nregardless of its position in the chain of the extension headers in IPv6\npacket, and makes sure that the IPv6 routing extension header is of Type 4.\n\nSigned-off-by: Ahmed Abdelsalam <amsalam20@gmail.com>\n---\nThe patch is tested for IPv6 packets that has the SRH immediately after\nIPv6 header as well as IPv6 packets with Hop-by-Hop appearing before SRH.\nHereafter, hexdump of IPv6 packet in both cases along with the value of\nthe SRH offset.\n\n[ 661.433676] 00000000: 60 03 a4 cd 00 b0 2b 3f 00 0a 00 00 00 00 00 00\n[ 661.433691] 00000010: 00 00 00 00 00 00 00 01 00 02 00 00 00 00 00 00\n[ 661.433695] 00000020: 00 00 00 00 0a d6 00 f1 29 08 04 03 03 00 00 00\n[ 661.433699] 00000030: 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 d6\n[ 661.433703] 00000040: 00 02 00 00 00 00 00 00 00 00 00 00 0a d6 00 f3\n[ 661.433707] 00000050: 00 02 00 00 00 00 00 00 00 00 00 00 0a d6 00 f2\n[ 661.433711] 00000060: 00 02 00 00 00 00 00 00 00 00 00 00 0a d6 00 f1\n[ 661.433715] 00000070: 60 03 a4 cd 00 40 3a 40 00 0a 00 00 00 00 00 00\n[ 661.433719] 00000080: 00 00 00 00 00 00 00 02 00 0b 00 00 00 00 00 00\n[ 661.433723] 00000090: 00 00 00 00 00 00 00 02 80 00 99 f5 0a 20 00 1d\n[ 661.433727] 000000a0: ef 72 a6 59 00 00 00 00 82 9a 04 00 00 00 00 00\n[ 661.433731] 000000b0: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f\n[ 661.433735] 000000c0: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f\n[ 661.433739] 000000d0: 30 31 32 33 34 35 36 37\n[ 661.433743] srhoff = 40\n\n[ 661.433754] 00000000: 60 03 a4 cd 00 b0 00 3f 00 0a 00 00 00 00 00 00\n[ 661.433758] 00000010: 00 00 00 00 00 00 00 01 00 02 00 00 00 00 00 00\n[ 661.433762] 00000020: 00 00 00 00 0a d6 00 f1 2b 00 10 00 00 00 00 00\n[ 661.433766] 00000030: 29 08 04 03 03 00 00 00 00 03 00 00 00 00 00 00\n[ 661.433770] 00000040: 00 00 00 00 00 00 00 d6 00 02 00 00 00 00 00 00\n[ 661.433774] 00000050: 00 00 00 00 0a d6 00 f3 00 02 00 00 00 00 00 00\n[ 661.433778] 00000060: 00 00 00 00 0a d6 00 f2 00 02 00 00 00 00 00 00\n[ 661.433782] 00000070: 00 00 00 00 0a d6 00 f1 60 03 a4 cd 00 40 3a 40\n[ 661.433786] 00000080: 00 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 02\n[ 661.433790] 00000090: 00 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 02\n[ 661.433794] 000000a0: 80 00 99 f5 0a 20 00 1d ef 72 a6 59 00 00 00 00\n[ 661.433798] 000000b0: 82 9a 04 00 00 00 00 00 10 11 12 13 14 15 16 17\n[ 661.433801] 000000c0: 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27\n[ 661.433805] 000000d0: 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37\n[ 661.433809] srhoff = 48\n\n net/ipv6/seg6_local.c | 18 ++++++++++++------\n 1 file changed, 12 insertions(+), 6 deletions(-)", "diff": "diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c\nindex 9c1a885..7ff54db 100644\n--- a/net/ipv6/seg6_local.c\n+++ b/net/ipv6/seg6_local.c\n@@ -62,17 +62,23 @@ static struct seg6_local_lwt *seg6_local_lwtunnel(struct lwtunnel_state *lwt)\n static struct ipv6_sr_hdr *get_srh(struct sk_buff *skb)\n {\n \tstruct ipv6_sr_hdr *srh;\n-\tstruct ipv6hdr *hdr;\n-\tint len;\n+\tint len, srhoff = 0;\n+\n+\tif (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)\n+\t\treturn NULL;\n+\n+\tif (!pskb_may_pull(skb, srhoff + sizeof(*srh)))\n+\t\treturn NULL;\n+\n+\tsrh = (struct ipv6_sr_hdr *)(skb->data + srhoff);\n \n-\thdr = ipv6_hdr(skb);\n-\tif (hdr->nexthdr != IPPROTO_ROUTING)\n+\t/* make sure it's a Segment Routing header (Routing Type 4) */\n+\tif (srh->type != IPV6_SRCRT_TYPE_4)\n \t\treturn NULL;\n \n-\tsrh = (struct ipv6_sr_hdr *)(hdr + 1);\n \tlen = (srh->hdrlen + 1) << 3;\n \n-\tif (!pskb_may_pull(skb, sizeof(*hdr) + len))\n+\tif (!pskb_may_pull(skb, srhoff + len))\n \t\treturn NULL;\n \n \tif (!seg6_validate_srh(srh, len))\n", "prefixes": [ "v2" ] }