get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/642976/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 642976,
    "url": "http://patchwork.ozlabs.org/api/patches/642976/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1467378549-9646-15-git-send-email-sw@simonwunderlich.de/",
    "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": "<1467378549-9646-15-git-send-email-sw@simonwunderlich.de>",
    "list_archive_url": null,
    "date": "2016-07-01T13:09:06",
    "name": "[14/17] batman-adv: Always flood IGMP/MLD reports",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "55502f244214611c185df724ae84a8c3e4252ce2",
    "submitter": {
        "id": 47054,
        "url": "http://patchwork.ozlabs.org/api/people/47054/?format=api",
        "name": "Simon Wunderlich",
        "email": "sw@simonwunderlich.de"
    },
    "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/1467378549-9646-15-git-send-email-sw@simonwunderlich.de/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/642976/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/642976/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3rgxp44HqXz9sxR\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Jul 2016 23:19:24 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932144AbcGANTV (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Jul 2016 09:19:21 -0400",
            "from packetmixer.de ([79.140.42.25]:53549 \"EHLO\n\tmail.mail.packetmixer.de\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752399AbcGANS3 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 1 Jul 2016 09:18:29 -0400",
            "from kero.packetmixer.de\n\t(p2003007C6F757900527B9DFFFECE2EDC.dip0.t-ipconnect.de\n\t[IPv6:2003:7c:6f75:7900:527b:9dff:fece:2edc])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mail.packetmixer.de (Postfix) with ESMTPSA id 965AE174010;\n\tFri,  1 Jul 2016 15:09:20 +0200 (CEST)"
        ],
        "From": "Simon Wunderlich <sw@simonwunderlich.de>",
        "To": "davem@davemloft.net",
        "Cc": "netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,\n\t=?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>,\n\tMarek Lindner <mareklindner@neomailbox.ch>,\n\tSven Eckelmann <sven@narfation.org>,\n\tSimon Wunderlich <sw@simonwunderlich.de>",
        "Subject": "[PATCH 14/17] batman-adv: Always flood IGMP/MLD reports",
        "Date": "Fri,  1 Jul 2016 15:09:06 +0200",
        "Message-Id": "<1467378549-9646-15-git-send-email-sw@simonwunderlich.de>",
        "X-Mailer": "git-send-email 2.8.1",
        "In-Reply-To": "<1467378549-9646-1-git-send-email-sw@simonwunderlich.de>",
        "References": "<1467378549-9646-1-git-send-email-sw@simonwunderlich.de>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Linus Lüssing <linus.luessing@c0d3.blue>\n\nWith this patch IGMP or MLD reports are always flooded. This is\nnecessary for the upcoming bridge integration to function without\nmulticast packet loss.\n\nWith the report handling so far bridges might miss interested multicast\nlisteners, leading to wrongly excluding ports from multicast packet\nforwarding.\n\nCurrently we are treating IGMP/MLD reports, the messages bridges use to\nlearn about interested multicast listeners, just as any other multicast\npacket: We try to send them to nodes matching its multicast destination.\n\nUnfortunately, the destination address of reports of the older\nIGMPv2/MLDv1 protocol families do not strictly adhere to their own\nprotocol: More precisely, the interested receiver, an IGMPv2 or MLDv1\nquerier, itself usually does not listen to the multicast destination\naddress of any reports.\n\nTherefore with this patch we are simply excluding IGMP/MLD reports from\nthe multicast forwarding code path and keep flooding them. By that\nany bridge receives them and can properly learn about listeners.\n\nTo avoid compatibility issues with older nodes not yet implementing this\nreport handling, we need to force them to flood reports: We do this by\nbumping the multicast TVLV version to 2, effectively disabling their\nmulticast optimization.\n\nTested-by: Simon Wunderlich <sw@simonwunderlich.de>\nSigned-off-by: Linus Lüssing <linus.luessing@c0d3.blue>\nSigned-off-by: Marek Lindner <mareklindner@neomailbox.ch>\nSigned-off-by: Sven Eckelmann <sven@narfation.org>\nSigned-off-by: Simon Wunderlich <sw@simonwunderlich.de>\n---\n net/batman-adv/Kconfig     |  2 +-\n net/batman-adv/multicast.c | 87 +++++++++++++++++++++++++++++++++++++++-------\n 2 files changed, 75 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig\nindex f66930e..b7ba97d 100644\n--- a/net/batman-adv/Kconfig\n+++ b/net/batman-adv/Kconfig\n@@ -66,7 +66,7 @@ config BATMAN_ADV_NC\n \n config BATMAN_ADV_MCAST\n \tbool \"Multicast optimisation\"\n-\tdepends on BATMAN_ADV\n+\tdepends on BATMAN_ADV && INET\n \tdefault n\n \thelp\n \t  This option enables the multicast optimisation which aims to\ndiff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c\nindex c32f24f..4673328 100644\n--- a/net/batman-adv/multicast.c\n+++ b/net/batman-adv/multicast.c\n@@ -25,9 +25,11 @@\n #include <linux/errno.h>\n #include <linux/etherdevice.h>\n #include <linux/fs.h>\n+#include <linux/icmpv6.h>\n #include <linux/if_ether.h>\n-#include <linux/in6.h>\n+#include <linux/igmp.h>\n #include <linux/in.h>\n+#include <linux/in6.h>\n #include <linux/ip.h>\n #include <linux/ipv6.h>\n #include <linux/kref.h>\n@@ -236,7 +238,7 @@ static bool batadv_mcast_mla_tvlv_update(struct batadv_priv *bat_priv)\n \tif (batadv_mcast_has_bridge(bat_priv)) {\n \t\tif (bat_priv->mcast.enabled) {\n \t\t\tbatadv_tvlv_container_unregister(bat_priv,\n-\t\t\t\t\t\t\t BATADV_TVLV_MCAST, 1);\n+\t\t\t\t\t\t\t BATADV_TVLV_MCAST, 2);\n \t\t\tbat_priv->mcast.enabled = false;\n \t\t}\n \n@@ -245,7 +247,7 @@ static bool batadv_mcast_mla_tvlv_update(struct batadv_priv *bat_priv)\n \n \tif (!bat_priv->mcast.enabled ||\n \t    mcast_data.flags != bat_priv->mcast.flags) {\n-\t\tbatadv_tvlv_container_register(bat_priv, BATADV_TVLV_MCAST, 1,\n+\t\tbatadv_tvlv_container_register(bat_priv, BATADV_TVLV_MCAST, 2,\n \t\t\t\t\t       &mcast_data, sizeof(mcast_data));\n \t\tbat_priv->mcast.flags = mcast_data.flags;\n \t\tbat_priv->mcast.enabled = true;\n@@ -283,6 +285,31 @@ out:\n }\n \n /**\n+ * batadv_mcast_is_report_ipv4 - check for IGMP reports\n+ * @skb: the ethernet frame destined for the mesh\n+ *\n+ * This call might reallocate skb data.\n+ *\n+ * Checks whether the given frame is a valid IGMP report.\n+ *\n+ * Return: If so then true, otherwise false.\n+ */\n+static bool batadv_mcast_is_report_ipv4(struct sk_buff *skb)\n+{\n+\tif (ip_mc_check_igmp(skb, NULL) < 0)\n+\t\treturn false;\n+\n+\tswitch (igmp_hdr(skb)->type) {\n+\tcase IGMP_HOST_MEMBERSHIP_REPORT:\n+\tcase IGMPV2_HOST_MEMBERSHIP_REPORT:\n+\tcase IGMPV3_HOST_MEMBERSHIP_REPORT:\n+\t\treturn true;\n+\t}\n+\n+\treturn false;\n+}\n+\n+/**\n  * batadv_mcast_forw_mode_check_ipv4 - check for optimized forwarding potential\n  * @bat_priv: the bat priv with all the soft interface information\n  * @skb: the IPv4 packet to check\n@@ -304,6 +331,9 @@ static int batadv_mcast_forw_mode_check_ipv4(struct batadv_priv *bat_priv,\n \tif (!pskb_may_pull(skb, sizeof(struct ethhdr) + sizeof(*iphdr)))\n \t\treturn -ENOMEM;\n \n+\tif (batadv_mcast_is_report_ipv4(skb))\n+\t\treturn -EINVAL;\n+\n \tiphdr = ip_hdr(skb);\n \n \t/* TODO: Implement Multicast Router Discovery (RFC4286),\n@@ -320,6 +350,31 @@ static int batadv_mcast_forw_mode_check_ipv4(struct batadv_priv *bat_priv,\n \treturn 0;\n }\n \n+#if IS_ENABLED(CONFIG_IPV6)\n+/**\n+ * batadv_mcast_is_report_ipv6 - check for MLD reports\n+ * @skb: the ethernet frame destined for the mesh\n+ *\n+ * This call might reallocate skb data.\n+ *\n+ * Checks whether the given frame is a valid MLD report.\n+ *\n+ * Return: If so then true, otherwise false.\n+ */\n+static bool batadv_mcast_is_report_ipv6(struct sk_buff *skb)\n+{\n+\tif (ipv6_mc_check_mld(skb, NULL) < 0)\n+\t\treturn false;\n+\n+\tswitch (icmp6_hdr(skb)->icmp6_type) {\n+\tcase ICMPV6_MGM_REPORT:\n+\tcase ICMPV6_MLD2_REPORT:\n+\t\treturn true;\n+\t}\n+\n+\treturn false;\n+}\n+\n /**\n  * batadv_mcast_forw_mode_check_ipv6 - check for optimized forwarding potential\n  * @bat_priv: the bat priv with all the soft interface information\n@@ -341,6 +396,9 @@ static int batadv_mcast_forw_mode_check_ipv6(struct batadv_priv *bat_priv,\n \tif (!pskb_may_pull(skb, sizeof(struct ethhdr) + sizeof(*ip6hdr)))\n \t\treturn -ENOMEM;\n \n+\tif (batadv_mcast_is_report_ipv6(skb))\n+\t\treturn -EINVAL;\n+\n \tip6hdr = ipv6_hdr(skb);\n \n \t/* TODO: Implement Multicast Router Discovery (RFC4286),\n@@ -357,6 +415,7 @@ static int batadv_mcast_forw_mode_check_ipv6(struct batadv_priv *bat_priv,\n \n \treturn 0;\n }\n+#endif\n \n /**\n  * batadv_mcast_forw_mode_check - check for optimized forwarding potential\n@@ -385,9 +444,11 @@ static int batadv_mcast_forw_mode_check(struct batadv_priv *bat_priv,\n \tcase ETH_P_IP:\n \t\treturn batadv_mcast_forw_mode_check_ipv4(bat_priv, skb,\n \t\t\t\t\t\t\t is_unsnoopable);\n+#if IS_ENABLED(CONFIG_IPV6)\n \tcase ETH_P_IPV6:\n \t\treturn batadv_mcast_forw_mode_check_ipv6(bat_priv, skb,\n \t\t\t\t\t\t\t is_unsnoopable);\n+#endif\n \tdefault:\n \t\treturn -EINVAL;\n \t}\n@@ -728,18 +789,18 @@ static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,\n }\n \n /**\n- * batadv_mcast_tvlv_ogm_handler_v1 - process incoming multicast tvlv container\n+ * batadv_mcast_tvlv_ogm_handler - process incoming multicast tvlv container\n  * @bat_priv: the bat priv with all the soft interface information\n  * @orig: the orig_node of the ogm\n  * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags)\n  * @tvlv_value: tvlv buffer containing the multicast data\n  * @tvlv_value_len: tvlv buffer length\n  */\n-static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,\n-\t\t\t\t\t     struct batadv_orig_node *orig,\n-\t\t\t\t\t     u8 flags,\n-\t\t\t\t\t     void *tvlv_value,\n-\t\t\t\t\t     u16 tvlv_value_len)\n+static void batadv_mcast_tvlv_ogm_handler(struct batadv_priv *bat_priv,\n+\t\t\t\t\t  struct batadv_orig_node *orig,\n+\t\t\t\t\t  u8 flags,\n+\t\t\t\t\t  void *tvlv_value,\n+\t\t\t\t\t  u16 tvlv_value_len)\n {\n \tbool orig_mcast_enabled = !(flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND);\n \tu8 mcast_flags = BATADV_NO_FLAGS;\n@@ -789,8 +850,8 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,\n  */\n void batadv_mcast_init(struct batadv_priv *bat_priv)\n {\n-\tbatadv_tvlv_handler_register(bat_priv, batadv_mcast_tvlv_ogm_handler_v1,\n-\t\t\t\t     NULL, BATADV_TVLV_MCAST, 1,\n+\tbatadv_tvlv_handler_register(bat_priv, batadv_mcast_tvlv_ogm_handler,\n+\t\t\t\t     NULL, BATADV_TVLV_MCAST, 2,\n \t\t\t\t     BATADV_TVLV_HANDLER_OGM_CIFNOTFND);\n }\n \n@@ -800,8 +861,8 @@ void batadv_mcast_init(struct batadv_priv *bat_priv)\n  */\n void batadv_mcast_free(struct batadv_priv *bat_priv)\n {\n-\tbatadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 1);\n-\tbatadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST, 1);\n+\tbatadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2);\n+\tbatadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST, 2);\n \n \tspin_lock_bh(&bat_priv->tt.commit_lock);\n \tbatadv_mcast_mla_tt_retract(bat_priv, NULL);\n",
    "prefixes": [
        "14/17"
    ]
}