tr-bridge: manually filter non-LLC frames in software
This commit is contained in:
parent
8e888081c7
commit
afa6f7119c
10
tr-bridge.c
10
tr-bridge.c
|
@ -214,6 +214,11 @@ static int eth2tr(struct bridge_state *bst)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (ethh->h_proto != htons(ETH_P_802_2)) {
|
||||
fprintf(stderr, "TR<-ETH: Not bridging unexpected frame for proto 0x%04x\n", ntohs(ethh->h_proto));
|
||||
return 0;
|
||||
}
|
||||
|
||||
trh.ac = AC;
|
||||
trh.fc = LLC_FRAME;
|
||||
memcpy(&trh.daddr, ethh->h_dest, sizeof(trh.daddr));
|
||||
|
@ -259,6 +264,11 @@ static int tr2eth(struct bridge_state *bst)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (trh->fc != LLC_FRAME) {
|
||||
fprintf(stderr, "TR->ETH: Not bridging unexpected non-LLC frame for FC 0x%02x\n", trh->fc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(ðh.h_dest, trh->daddr, sizeof(ethh.h_dest));
|
||||
osmo_revbytebits_buf(ethh.h_dest, TR_ALEN);
|
||||
memcpy(ðh.h_source, trh->saddr, sizeof(ethh.h_source));
|
||||
|
|
Loading…
Reference in New Issue