summaryrefslogtreecommitdiff
path: root/src/ipcpd/eth
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-04-02 23:49:13 +0200
committerSander Vrijders <[email protected]>2018-04-05 10:33:05 +0200
commit6f7c2342f9cc8f8fa31e84d99dff0f2964676730 (patch)
tree2577c667e0873462a365f6be5379e707cb69284f /src/ipcpd/eth
parente76b3b5d796756ef68687adbed581501cfc4dd27 (diff)
downloadouroboros-6f7c2342f9cc8f8fa31e84d99dff0f2964676730.tar.gz
ouroboros-6f7c2342f9cc8f8fa31e84d99dff0f2964676730.zip
ipcpd: Add ethertype check
An ethertype check was missing for the DIX ethernet IPCP, causing crashes if there is other traffic on the network. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd/eth')
-rw-r--r--src/ipcpd/eth/eth.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index 7a0510c9..5eb4e7cb 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -856,8 +856,14 @@ static void * eth_ipcp_sdu_reader(void * o)
#endif
length = ntohs(e_frame->length);
#if defined(BUILD_ETH_DIX)
- deid = ntohs(e_frame->eid);
+ if (e_frame->ethertype != eth_data.ethertype) {
+#ifndef HAVE_NETMAP
+ ipcp_sdb_release(sdb);
+#endif
+ continue;
+ }
+ deid = ntohs(e_frame->eid);
if (deid == MGMT_EID) {
#elif defined (BUILD_ETH_LLC)
if (length > 0x05FF) {/* DIX */