summaryrefslogtreecommitdiff
path: root/src/ipcpd
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-09-27 11:47:14 +0200
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-09-27 14:18:52 +0200
commit3beb3927d0207db06e24228c314a2199b0be27d3 (patch)
treeda4fe5b93371ff8cf7e8e3c678a38230f70078c6 /src/ipcpd
parente569fed013e7e01b49b591b192eabdb0431b4976 (diff)
downloadouroboros-3beb3927d0207db06e24228c314a2199b0be27d3.tar.gz
ouroboros-3beb3927d0207db06e24228c314a2199b0be27d3.zip
ipcpd: Remove double close in Ethernet IPCP
There was a double close of a fd in the Ethernet IPCP. It also passes the correct max length to a memcpy (a strlen of the source string was used previously). Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/ipcpd')
-rw-r--r--src/ipcpd/eth/eth.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index 114cafce..04debfd1 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -1200,7 +1200,7 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
}
memset(&ifr, 0, sizeof(ifr));
- memcpy(ifr.ifr_name, conf->dev, strlen(conf->dev));
+ memcpy(ifr.ifr_name, conf->dev, IFNAMSIZ);
#ifdef BUILD_ETH_DIX
if (conf->ethertype < 0x0600 || conf->ethertype == 0xFFFF) {
@@ -1276,7 +1276,6 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
idx = if_nametoindex(conf->dev);
if (idx == 0) {
log_err("Failed to retrieve interface index.");
- close(skfd);
return -1;
}
#endif /* __FreeBSD__ */