kernel: disable multicast-to-unicast translation for ipv6 neighbor solicitation ...
authorFelix Fietkau <nbd@openwrt.org>
Wed, 17 Dec 2014 12:27:14 +0000 (12:27 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 17 Dec 2014 12:27:14 +0000 (12:27 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 43736

target/linux/generic/patches-3.10/645-bridge_multicast_to_unicast.patch
target/linux/generic/patches-3.14/645-bridge_multicast_to_unicast.patch
target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch

index 9ee6b01df071a7c6576612b625e4074c79fa22d8..283157ac9737e27901f092914392231bec1bf1dd 100644 (file)
  {
        struct br_ip br_group;
  
-@@ -735,7 +757,7 @@ static int br_ip6_multicast_add_group(st
+@@ -735,7 +757,10 @@ static int br_ip6_multicast_add_group(st
        br_group.proto = htons(ETH_P_IPV6);
        br_group.vid = vid;
  
 -      return br_multicast_add_group(br, port, &br_group);
++      if (ipv6_addr_is_solict_mult(group))
++              src = NULL;
++
 +      return br_multicast_add_group(br, port, &br_group, src);
  }
  #endif
  
-@@ -949,6 +971,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -949,6 +974,7 @@ static int br_ip4_multicast_igmp3_report
                                         struct net_bridge_port *port,
                                         struct sk_buff *skb)
  {
        struct igmpv3_report *ih;
        struct igmpv3_grec *grec;
        int i;
-@@ -994,7 +1017,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -994,7 +1020,7 @@ static int br_ip4_multicast_igmp3_report
                        continue;
                }
  
                if (err)
                        break;
        }
-@@ -1007,6 +1030,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1007,6 +1033,7 @@ static int br_ip6_multicast_mld2_report(
                                        struct net_bridge_port *port,
                                        struct sk_buff *skb)
  {
        struct icmp6hdr *icmp6h;
        struct mld2_grec *grec;
        int i;
-@@ -1057,7 +1081,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1057,7 +1084,7 @@ static int br_ip6_multicast_mld2_report(
                }
  
                err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
                if (!err)
                        break;
        }
-@@ -1302,7 +1326,8 @@ static void br_multicast_leave_group(str
+@@ -1302,7 +1329,8 @@ static void br_multicast_leave_group(str
                                     struct net_bridge_port *port,
                                     struct br_ip *group,
                                     struct bridge_mcast_querier *querier,
  {
        struct net_bridge_mdb_htable *mdb;
        struct net_bridge_mdb_entry *mp;
-@@ -1352,7 +1377,7 @@ static void br_multicast_leave_group(str
+@@ -1352,7 +1380,7 @@ static void br_multicast_leave_group(str
                for (pp = &mp->ports;
                     (p = mlock_dereference(*pp, br)) != NULL;
                     pp = &p->next) {
                                continue;
  
                        rcu_assign_pointer(*pp, p->next);
-@@ -1386,7 +1411,7 @@ static void br_multicast_leave_group(str
+@@ -1386,7 +1414,7 @@ static void br_multicast_leave_group(str
        for (p = mlock_dereference(mp->ports, br);
             p != NULL;
             p = mlock_dereference(p->next, br)) {
                        continue;
  
                if (!hlist_unhashed(&p->mglist) &&
-@@ -1404,8 +1429,8 @@ out:
+@@ -1404,8 +1432,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
                                         struct net_bridge_port *port,
  {
        struct br_ip br_group;
        struct bridge_mcast_query *query = port ? &port->ip4_query :
-@@ -1418,14 +1443,15 @@ static void br_ip4_multicast_leave_group
+@@ -1418,14 +1446,15 @@ static void br_ip4_multicast_leave_group
        br_group.proto = htons(ETH_P_IP);
        br_group.vid = vid;
  
  {
        struct br_ip br_group;
        struct bridge_mcast_query *query = port ? &port->ip6_query :
-@@ -1439,7 +1465,8 @@ static void br_ip6_multicast_leave_group
+@@ -1439,7 +1468,8 @@ static void br_ip6_multicast_leave_group
        br_group.proto = htons(ETH_P_IPV6);
        br_group.vid = vid;
  
  }
  #endif
  
-@@ -1447,6 +1474,7 @@ static int br_multicast_ipv4_rcv(struct 
+@@ -1447,6 +1477,7 @@ static int br_multicast_ipv4_rcv(struct 
                                 struct net_bridge_port *port,
                                 struct sk_buff *skb)
  {
        struct sk_buff *skb2 = skb;
        const struct iphdr *iph;
        struct igmphdr *ih;
-@@ -1522,7 +1550,7 @@ static int br_multicast_ipv4_rcv(struct 
+@@ -1522,7 +1553,7 @@ static int br_multicast_ipv4_rcv(struct 
        case IGMP_HOST_MEMBERSHIP_REPORT:
        case IGMPV2_HOST_MEMBERSHIP_REPORT:
                BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
                break;
        case IGMPV3_HOST_MEMBERSHIP_REPORT:
                err = br_ip4_multicast_igmp3_report(br, port, skb2);
-@@ -1531,7 +1559,7 @@ static int br_multicast_ipv4_rcv(struct 
+@@ -1531,7 +1562,7 @@ static int br_multicast_ipv4_rcv(struct 
                err = br_ip4_multicast_query(br, port, skb2);
                break;
        case IGMP_HOST_LEAVE_MESSAGE:
                break;
        }
  
-@@ -1548,6 +1576,7 @@ static int br_multicast_ipv6_rcv(struct 
+@@ -1548,6 +1579,7 @@ static int br_multicast_ipv6_rcv(struct 
                                 struct net_bridge_port *port,
                                 struct sk_buff *skb)
  {
        struct sk_buff *skb2;
        const struct ipv6hdr *ip6h;
        u8 icmp6_type;
-@@ -1659,7 +1688,8 @@ static int br_multicast_ipv6_rcv(struct 
+@@ -1659,7 +1691,8 @@ static int br_multicast_ipv6_rcv(struct 
                }
                mld = (struct mld_msg *)skb_transport_header(skb2);
                BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
                break;
            }
        case ICMPV6_MLD2_REPORT:
-@@ -1676,7 +1706,7 @@ static int br_multicast_ipv6_rcv(struct 
+@@ -1676,7 +1709,7 @@ static int br_multicast_ipv6_rcv(struct 
                        goto out;
                }
                mld = (struct mld_msg *)skb_transport_header(skb2);
index 27cfe4e14c224becdad6d868f6cbcab965eec70b..a9cd86170a17216c7d8ccb0675d3fd245b8c6d19 100644 (file)
  {
        struct br_ip br_group;
  
-@@ -735,7 +757,7 @@ static int br_ip6_multicast_add_group(st
+@@ -735,7 +757,10 @@ static int br_ip6_multicast_add_group(st
        br_group.proto = htons(ETH_P_IPV6);
        br_group.vid = vid;
  
 -      return br_multicast_add_group(br, port, &br_group);
++      if (ipv6_addr_is_solict_mult(group))
++              src = NULL;
++
 +      return br_multicast_add_group(br, port, &br_group, src);
  }
  #endif
  
-@@ -950,6 +972,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -950,6 +975,7 @@ static int br_ip4_multicast_igmp3_report
                                         struct sk_buff *skb,
                                         u16 vid)
  {
        struct igmpv3_report *ih;
        struct igmpv3_grec *grec;
        int i;
-@@ -993,7 +1016,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -993,7 +1019,7 @@ static int br_ip4_multicast_igmp3_report
                        continue;
                }
  
                if (err)
                        break;
        }
-@@ -1007,6 +1030,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1007,6 +1033,7 @@ static int br_ip6_multicast_mld2_report(
                                        struct sk_buff *skb,
                                        u16 vid)
  {
        struct icmp6hdr *icmp6h;
        struct mld2_grec *grec;
        int i;
-@@ -1055,7 +1079,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1055,7 +1082,7 @@ static int br_ip6_multicast_mld2_report(
                }
  
                err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
                if (!err)
                        break;
        }
-@@ -1319,7 +1343,8 @@ static void br_multicast_leave_group(str
+@@ -1319,7 +1346,8 @@ static void br_multicast_leave_group(str
                                     struct net_bridge_port *port,
                                     struct br_ip *group,
                                     struct bridge_mcast_querier *querier,
  {
        struct net_bridge_mdb_htable *mdb;
        struct net_bridge_mdb_entry *mp;
-@@ -1369,7 +1394,7 @@ static void br_multicast_leave_group(str
+@@ -1369,7 +1397,7 @@ static void br_multicast_leave_group(str
                for (pp = &mp->ports;
                     (p = mlock_dereference(*pp, br)) != NULL;
                     pp = &p->next) {
                                continue;
  
                        rcu_assign_pointer(*pp, p->next);
-@@ -1403,7 +1428,7 @@ static void br_multicast_leave_group(str
+@@ -1403,7 +1431,7 @@ static void br_multicast_leave_group(str
        for (p = mlock_dereference(mp->ports, br);
             p != NULL;
             p = mlock_dereference(p->next, br)) {
                        continue;
  
                if (!hlist_unhashed(&p->mglist) &&
-@@ -1421,8 +1446,8 @@ out:
+@@ -1421,8 +1449,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
                                         struct net_bridge_port *port,
  {
        struct br_ip br_group;
        struct bridge_mcast_query *query = port ? &port->ip4_query :
-@@ -1435,14 +1460,15 @@ static void br_ip4_multicast_leave_group
+@@ -1435,14 +1463,15 @@ static void br_ip4_multicast_leave_group
        br_group.proto = htons(ETH_P_IP);
        br_group.vid = vid;
  
  {
        struct br_ip br_group;
        struct bridge_mcast_query *query = port ? &port->ip6_query :
-@@ -1456,7 +1482,8 @@ static void br_ip6_multicast_leave_group
+@@ -1456,7 +1485,8 @@ static void br_ip6_multicast_leave_group
        br_group.proto = htons(ETH_P_IPV6);
        br_group.vid = vid;
  
  }
  #endif
  
-@@ -1465,6 +1492,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1465,6 +1495,7 @@ static int br_multicast_ipv4_rcv(struct 
                                 struct sk_buff *skb,
                                 u16 vid)
  {
        struct sk_buff *skb2 = skb;
        const struct iphdr *iph;
        struct igmphdr *ih;
-@@ -1538,7 +1566,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1538,7 +1569,7 @@ static int br_multicast_ipv4_rcv(struct 
        case IGMP_HOST_MEMBERSHIP_REPORT:
        case IGMPV2_HOST_MEMBERSHIP_REPORT:
                BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
                break;
        case IGMPV3_HOST_MEMBERSHIP_REPORT:
                err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
-@@ -1547,7 +1575,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1547,7 +1578,7 @@ static int br_multicast_ipv4_rcv(struct 
                err = br_ip4_multicast_query(br, port, skb2, vid);
                break;
        case IGMP_HOST_LEAVE_MESSAGE:
                break;
        }
  
-@@ -1565,6 +1593,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1565,6 +1596,7 @@ static int br_multicast_ipv6_rcv(struct 
                                 struct sk_buff *skb,
                                 u16 vid)
  {
        struct sk_buff *skb2;
        const struct ipv6hdr *ip6h;
        u8 icmp6_type;
-@@ -1674,7 +1703,8 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1674,7 +1706,8 @@ static int br_multicast_ipv6_rcv(struct 
                }
                mld = (struct mld_msg *)skb_transport_header(skb2);
                BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
                break;
            }
        case ICMPV6_MLD2_REPORT:
-@@ -1691,7 +1721,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1691,7 +1724,7 @@ static int br_multicast_ipv6_rcv(struct 
                        goto out;
                }
                mld = (struct mld_msg *)skb_transport_header(skb2);
index 8d0da3c6e5ff69066806ff79052987b7f0fffaf8..d870dc5d5f2f7c7b47ad5c9d21b4643b3b61fd63 100644 (file)
  {
        struct br_ip br_group;
  
-@@ -736,7 +758,7 @@ static int br_ip6_multicast_add_group(st
+@@ -736,7 +758,10 @@ static int br_ip6_multicast_add_group(st
        br_group.proto = htons(ETH_P_IPV6);
        br_group.vid = vid;
  
 -      return br_multicast_add_group(br, port, &br_group);
++      if (ipv6_addr_is_solict_mult(group))
++              src = NULL;
++
 +      return br_multicast_add_group(br, port, &br_group, src);
  }
  #endif
  
-@@ -965,6 +987,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -965,6 +990,7 @@ static int br_ip4_multicast_igmp3_report
                                         struct sk_buff *skb,
                                         u16 vid)
  {
        struct igmpv3_report *ih;
        struct igmpv3_grec *grec;
        int i;
-@@ -1008,7 +1031,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -1008,7 +1034,7 @@ static int br_ip4_multicast_igmp3_report
                        continue;
                }
  
                if (err)
                        break;
        }
-@@ -1022,6 +1045,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1022,6 +1048,7 @@ static int br_ip6_multicast_mld2_report(
                                        struct sk_buff *skb,
                                        u16 vid)
  {
        struct icmp6hdr *icmp6h;
        struct mld2_grec *grec;
        int i;
-@@ -1070,7 +1094,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1070,7 +1097,7 @@ static int br_ip6_multicast_mld2_report(
                }
  
                err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
                if (!err)
                        break;
        }
-@@ -1407,7 +1431,8 @@ br_multicast_leave_group(struct net_brid
+@@ -1407,7 +1434,8 @@ br_multicast_leave_group(struct net_brid
                         struct net_bridge_port *port,
                         struct br_ip *group,
                         struct bridge_mcast_other_query *other_query,
  {
        struct net_bridge_mdb_htable *mdb;
        struct net_bridge_mdb_entry *mp;
-@@ -1457,7 +1482,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1457,7 +1485,7 @@ br_multicast_leave_group(struct net_brid
                for (pp = &mp->ports;
                     (p = mlock_dereference(*pp, br)) != NULL;
                     pp = &p->next) {
                                continue;
  
                        rcu_assign_pointer(*pp, p->next);
-@@ -1491,7 +1516,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1491,7 +1519,7 @@ br_multicast_leave_group(struct net_brid
        for (p = mlock_dereference(mp->ports, br);
             p != NULL;
             p = mlock_dereference(p->next, br)) {
                        continue;
  
                if (!hlist_unhashed(&p->mglist) &&
-@@ -1509,8 +1534,8 @@ out:
+@@ -1509,8 +1537,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
                                         struct net_bridge_port *port,
  {
        struct br_ip br_group;
        struct bridge_mcast_own_query *own_query;
-@@ -1525,14 +1550,14 @@ static void br_ip4_multicast_leave_group
+@@ -1525,14 +1553,14 @@ static void br_ip4_multicast_leave_group
        br_group.vid = vid;
  
        br_multicast_leave_group(br, port, &br_group, &br->ip4_other_query,
  {
        struct br_ip br_group;
        struct bridge_mcast_own_query *own_query;
-@@ -1547,7 +1572,7 @@ static void br_ip6_multicast_leave_group
+@@ -1547,7 +1575,7 @@ static void br_ip6_multicast_leave_group
        br_group.vid = vid;
  
        br_multicast_leave_group(br, port, &br_group, &br->ip6_other_query,
  }
  #endif
  
-@@ -1556,6 +1581,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1556,6 +1584,7 @@ static int br_multicast_ipv4_rcv(struct 
                                 struct sk_buff *skb,
                                 u16 vid)
  {
        struct sk_buff *skb2 = skb;
        const struct iphdr *iph;
        struct igmphdr *ih;
-@@ -1629,7 +1655,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1629,7 +1658,7 @@ static int br_multicast_ipv4_rcv(struct 
        case IGMP_HOST_MEMBERSHIP_REPORT:
        case IGMPV2_HOST_MEMBERSHIP_REPORT:
                BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
                break;
        case IGMPV3_HOST_MEMBERSHIP_REPORT:
                err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
-@@ -1638,7 +1664,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1638,7 +1667,7 @@ static int br_multicast_ipv4_rcv(struct 
                err = br_ip4_multicast_query(br, port, skb2, vid);
                break;
        case IGMP_HOST_LEAVE_MESSAGE:
                break;
        }
  
-@@ -1656,6 +1682,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1656,6 +1685,7 @@ static int br_multicast_ipv6_rcv(struct 
                                 struct sk_buff *skb,
                                 u16 vid)
  {
        struct sk_buff *skb2;
        const struct ipv6hdr *ip6h;
        u8 icmp6_type;
-@@ -1765,7 +1792,8 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1765,7 +1795,8 @@ static int br_multicast_ipv6_rcv(struct 
                }
                mld = (struct mld_msg *)skb_transport_header(skb2);
                BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
                break;
            }
        case ICMPV6_MLD2_REPORT:
-@@ -1782,7 +1810,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1782,7 +1813,7 @@ static int br_multicast_ipv6_rcv(struct 
                        goto out;
                }
                mld = (struct mld_msg *)skb_transport_header(skb2);