ref: c1eb4b8d6838109655744ce77e20472f8ea6a8ff
parent: 1f80d31f41a630860d1e1b5712546a3dc9993b4c
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Dec 18 15:47:55 EST 2017
devether: dont forward loopback packets on bridges
--- a/sys/src/9/kw/devether.c
+++ b/sys/src/9/kw/devether.c
@@ -177,8 +177,8 @@
if(f = *fp)
if(f->type == type || f->type < 0)
if(tome || multi || f->prom){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)
--- a/sys/src/9/mtx/devether.c
+++ b/sys/src/9/mtx/devether.c
@@ -169,8 +169,8 @@
if(f = *fp)
if(f->type == type || f->type < 0)
if(tome || multi || f->prom){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)
--- a/sys/src/9/omap/devether.c
+++ b/sys/src/9/omap/devether.c
@@ -176,8 +176,8 @@
for(fp = ether->f; fp < ep; fp++){
if((f = *fp) != nil && (f->type == type || f->type < 0) &&
(tome || multi || f->prom)){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)
--- a/sys/src/9/pc/devether.c
+++ b/sys/src/9/pc/devether.c
@@ -175,8 +175,8 @@
if(f = *fp)
if(f->type == type || f->type < 0)
if(tome || multi || f->prom){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)
--- a/sys/src/9/ppc/devether.c
+++ b/sys/src/9/ppc/devether.c
@@ -170,8 +170,8 @@
if(f = *fp)
if(f->type == type || f->type < 0)
if(tome || multi || f->prom){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)
--- a/sys/src/9/sgi/devether.c
+++ b/sys/src/9/sgi/devether.c
@@ -175,8 +175,8 @@
if(f = *fp)
if(f->type == type || f->type < 0)
if(tome || multi || f->prom){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)
--- a/sys/src/9/teg2/devether.c
+++ b/sys/src/9/teg2/devether.c
@@ -174,8 +174,8 @@
for(fp = ether->f; fp < ep; fp++){
if((f = *fp) != nil && (f->type == type || f->type < 0) &&
(tome || multi || f->prom)){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)
--- a/sys/src/9/zynq/devether.c
+++ b/sys/src/9/zynq/devether.c
@@ -175,8 +175,8 @@
if(f = *fp)
if(f->type == type || f->type < 0)
if(tome || multi || f->prom){
- /* Don't want to hear bridged packets */
- if(f->bridge && !fromwire && !fromme)
+ /* Don't want to hear loopback or bridged packets */
+ if(f->bridge && (tome || !fromwire && !fromme))
continue;
if(!f->headersonly){
if(fromwire && fx == 0)