Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
linux_grx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Intel
linux_grx
Commits
a78d3688
Commit
a78d3688
authored
7 years ago
by
Felix Fietkau
Committed by
Oussama Ghorbel
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
bridge: port isolate
Isolating individual bridge ports Signed-off-by:
Felix Fietkau
<
nbd@nbd.name
>
parent
28241146
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/linux/if_bridge.h
+1
-0
1 addition, 0 deletions
include/linux/if_bridge.h
net/bridge/br_forward.c
+5
-0
5 additions, 0 deletions
net/bridge/br_forward.c
net/bridge/br_input.c
+3
-0
3 additions, 0 deletions
net/bridge/br_input.c
net/bridge/br_sysfs_if.c
+2
-0
2 additions, 0 deletions
net/bridge/br_sysfs_if.c
with
11 additions
and
0 deletions
include/linux/if_bridge.h
+
1
−
0
View file @
a78d3688
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
net/bridge/br_forward.c
+
5
−
0
View file @
a78d3688
...
...
@@ -162,6 +162,9 @@ static int deliver_clone(const struct net_bridge_port *prev,
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
);
...
...
@@ -236,6 +239,8 @@ void br_flood(struct net_bridge *br, struct sk_buff *skb,
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
;
...
...
This diff is collapsed.
Click to expand it.
net/bridge/br_input.c
+
3
−
0
View file @
a78d3688
...
...
@@ -175,6 +175,9 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
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
);
...
...
This diff is collapsed.
Click to expand it.
net/bridge/br_sysfs_if.c
+
2
−
0
View file @
a78d3688
...
...
@@ -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 *brport_attrs[] = {
&
brport_attr_proxyarp
,
&
brport_attr_proxyarp_wifi
,
&
brport_attr_multicast_flood
,
&
brport_attr_isolate_mode
,
NULL
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment