X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fraw_socket_device.c;h=e2692ecc1f2ec72ab035d77227674ccd847a2718;hp=90ccedfc317544a43eae5c3390def2c13ae2e1e2;hb=708314df2f61675d0f54e541c9fff62ac1f433b5;hpb=178e52f76ef4ba40748c13ea7e518837394d6dbc diff --git a/src/raw_socket_device.c b/src/raw_socket_device.c index 90ccedfc..e2692ecc 100644 --- a/src/raw_socket_device.c +++ b/src/raw_socket_device.c @@ -1,7 +1,7 @@ /* device.c -- raw socket Copyright (C) 2002-2005 Ivo Timmermans, - 2002-2011 Guus Sliepen + 2002-2012 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,6 +53,10 @@ static bool setup_device(void) { return false; } +#ifdef FD_CLOEXEC + fcntl(device_fd, F_SETFD, FD_CLOEXEC); +#endif + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); if(ioctl(device_fd, SIOCGIFINDEX, &ifr)) {