diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-01-27 14:32:10 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-02-04 20:28:14 +0100 |
commit | f791fb4af45032a653ba7c850f4564923871cb16 (patch) | |
tree | c1fc4e564c8e27faad582e5b55a9ce91816a241c /target/linux/generic/patches-4.9/641-bridge_port_isolate.patch | |
parent | 7d00cfe9bb693e376ac9d035e13f8ce8a5ff572c (diff) | |
download | upstream-f791fb4af45032a653ba7c850f4564923871cb16.tar.gz upstream-f791fb4af45032a653ba7c850f4564923871cb16.tar.bz2 upstream-f791fb4af45032a653ba7c850f4564923871cb16.zip |
kernel: add linux 4.9 support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Tim Harvey <tharvey@gateworks.com> [fixes]
Diffstat (limited to 'target/linux/generic/patches-4.9/641-bridge_port_isolate.patch')
-rw-r--r-- | target/linux/generic/patches-4.9/641-bridge_port_isolate.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.9/641-bridge_port_isolate.patch b/target/linux/generic/patches-4.9/641-bridge_port_isolate.patch new file mode 100644 index 0000000000..b55fd5db70 --- /dev/null +++ b/target/linux/generic/patches-4.9/641-bridge_port_isolate.patch @@ -0,0 +1,66 @@ +From: Felix Fietkau <nbd@nbd.name> +Subject: [PATCH] bridge: port isolate + +Isolating individual bridge ports +--- +--- a/include/linux/if_bridge.h ++++ b/include/linux/if_bridge.h +@@ -47,6 +47,7 @@ struct br_ip_list { + #define BR_PROXYARP_WIFI BIT(10) + #define BR_MCAST_FLOOD BIT(11) + #define BR_MULTICAST_TO_UNICAST BIT(12) ++#define BR_ISOLATE_MODE BIT(13) + + #define BR_DEFAULT_AGEING_TIME (300 * HZ) + +--- a/net/bridge/br_sysfs_if.c ++++ b/net/bridge/br_sysfs_if.c +@@ -172,6 +172,7 @@ BRPORT_ATTR_FLAG(unicast_flood, BR_FLOOD + BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP); + BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); + BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); ++BRPORT_ATTR_FLAG(isolate_mode, BR_ISOLATE_MODE); + + #ifdef CONFIG_BRIDGE_IGMP_SNOOPING + static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) +@@ -220,6 +221,7 @@ static const struct brport_attribute *br + &brport_attr_proxyarp, + &brport_attr_proxyarp_wifi, + &brport_attr_multicast_flood, ++ &brport_attr_isolate_mode, + NULL + }; + +--- a/net/bridge/br_forward.c ++++ b/net/bridge/br_forward.c +@@ -141,6 +141,9 @@ static int deliver_clone(const struct ne + void br_forward(const struct net_bridge_port *to, + struct sk_buff *skb, bool local_rcv, bool local_orig) + { ++ if (to->flags & BR_ISOLATE_MODE) ++ to = NULL; ++ + if (to && should_deliver(to, skb)) { + if (local_rcv) + deliver_clone(to, skb, local_orig); +@@ -206,6 +209,8 @@ void br_flood(struct net_bridge *br, str + struct net_bridge_port *p; + + list_for_each_entry_rcu(p, &br->port_list, list) { ++ if (!local_orig && (p->flags & BR_ISOLATE_MODE)) ++ continue; + /* Do not flood unicast traffic to ports that turn it off */ + if (pkt_type == BR_PKT_UNICAST && !(p->flags & BR_FLOOD)) + continue; +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -174,6 +174,9 @@ int br_handle_frame_finish(struct net *n + if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) + br_do_proxy_arp(skb, br, vid, p); + ++ if (p->flags & BR_ISOLATE_MODE) ++ return br_pass_frame_up(skb); ++ + switch (pkt_type) { + case BR_PKT_MULTICAST: + mdst = br_mdb_get(br, skb, vid); |