Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135255658
D28487.id83449.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D28487.id83449.diff
View Options
Index: share/man/man4/ng_bridge.4
===================================================================
--- share/man/man4/ng_bridge.4
+++ share/man/man4/ng_bridge.4
@@ -109,6 +109,22 @@
Frames with unknown MACs are always sent out to
.Dv uplink
hooks, so no functionality is lost.
+.Pp
+Frames with unknown destination MAC addresses are replicated to any
+available hook, unless the first connected hook is an
+.Ar uplink
+hook.
+In this case the node assumes, that all unknown MAC addresses are
+located soley on the
+.Ar uplink
+hooks and only those hooks will be used to send out frames with
+unknown destination MACs.
+If the first connected hook is an
+.Ar link
+hook, the node will replicate such frames to all types of hooks,
+even if
+.Ar uplink
+hooks are connected later.
.Sh CONTROL MESSAGES
This node type supports the generic control messages, plus the
following:
Index: sys/netgraph/ng_bridge.c
===================================================================
--- sys/netgraph/ng_bridge.c
+++ sys/netgraph/ng_bridge.c
@@ -105,7 +105,8 @@
u_int numBuckets; /* num buckets in table */
u_int hashMask; /* numBuckets - 1 */
int numLinks; /* num connected links */
- int persistent; /* can exist w/o hooks */
+ unsigned int persistent : 1, /* can exist w/o hooks */
+ sendUnknown : 1;/* links receive unknowns by default */
struct callout timer; /* one second periodic timer */
};
typedef struct ng_bridge_private *priv_p;
@@ -309,6 +310,7 @@
priv->conf.loopTimeout = DEFAULT_LOOP_TIMEOUT;
priv->conf.maxStaleness = DEFAULT_MAX_STALENESS;
priv->conf.minStableAge = DEFAULT_MIN_STABLE_AGE;
+ priv->sendUnknown = 1; /* classic bridge */
/*
* This node has all kinds of stuff that could be screwed by SMP.
@@ -371,9 +373,11 @@
if (isUplink) {
link->learnMac = 0;
link->sendUnknown = 1;
+ if (priv->numLinks == 0) /* if the first link is an uplink */
+ priv->sendUnknown = 0; /* switch to restrictive mode */
} else {
link->learnMac = 1;
- link->sendUnknown = 1;
+ link->sendUnknown = priv->sendUnknown;
}
NG_HOOK_SET_PRIVATE(hook, link);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 9, 12:57 AM (8 m, 52 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25055263
Default Alt Text
D28487.id83449.diff (2 KB)
Attached To
Mode
D28487: netgraph/ng_bridge: Derive forwarding mode from first attached hook
Attached
Detach File
Event Timeline
Log In to Comment