From 6f7c2342f9cc8f8fa31e84d99dff0f2964676730 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 2 Apr 2018 23:49:13 +0200 Subject: 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 Signed-off-by: Sander Vrijders --- src/ipcpd/eth/eth.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ipcpd/eth') 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 */ -- cgit v1.2.3