summaryrefslogtreecommitdiff
path: root/src/ipcpd/eth
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-03-11 10:30:30 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-12 10:32:17 +0100
commit6a4151baa8231cdaf746761fd8dc4aacb895c9e5 (patch)
tree5d9bf738c4fcf0463e207940011834bc51aaba56 /src/ipcpd/eth
parent103e9d80b2970b4e8fc1f45d3bf48d95b8937d6a (diff)
downloadouroboros-6a4151baa8231cdaf746761fd8dc4aacb895c9e5.tar.gz
ouroboros-6a4151baa8231cdaf746761fd8dc4aacb895c9e5.zip
ipcpd: Add validity checks for eth-dix
This will check if the Ethertype value is a valid Ethertype in the irm tool and the eth-dix IPCPd. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/ipcpd/eth')
-rw-r--r--src/ipcpd/eth/eth.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index 9bbadf91..90143d2f 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -1106,6 +1106,10 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
memcpy(ifr.ifr_name, conf->dev, strlen(conf->dev));
#ifdef BUILD_ETH_DIX
+ if (conf->ethertype < 0x0600 || conf->ethertype == 0xFFFF) {
+ log_err("Invalid Ethertype.");
+ return -1;
+ }
eth_data.ethertype = htons(conf->ethertype);
#endif