diff options
author | Sander Vrijders <[email protected]> | 2018-09-27 11:47:14 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2018-09-27 14:18:52 +0200 |
commit | 3beb3927d0207db06e24228c314a2199b0be27d3 (patch) | |
tree | da4fe5b93371ff8cf7e8e3c678a38230f70078c6 /src | |
parent | e569fed013e7e01b49b591b192eabdb0431b4976 (diff) | |
download | ouroboros-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 <[email protected]>
Signed-off-by: Dimitri Staessens <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/ipcpd/eth/eth.c | 3 |
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__ */ |