summaryrefslogtreecommitdiffstats
path: root/lpf.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-06-10 22:23:57 +0000
committerRoy Marples <roy@marples.name>2008-06-10 22:23:57 +0000
commiteb942e0abce48272767404ca604573d3ea674302 (patch)
tree479c4d8049b34bb3758034ca0bd2354dce079ce3 /lpf.c
parent7349c9bf8cf950dfb92d53f9a860f34b33d97229 (diff)
downloaddhcpcd-eb942e0abce48272767404ca604573d3ea674302.tar.xz
Remove the signal array stack as our pipe handling should be secure enough now. Also, move the normalize close_on_exec and setting non block.
Diffstat (limited to 'lpf.c')
-rw-r--r--lpf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lpf.c b/lpf.c
index c507378f..04d47b76 100644
--- a/lpf.c
+++ b/lpf.c
@@ -102,12 +102,11 @@ open_socket(struct interface *iface, int protocol)
}
if (setsockopt(s, SOL_SOCKET, SO_ATTACH_FILTER, &pf, sizeof(pf)) != 0)
goto eexit;
- if ((flags = fcntl(s, F_GETFL, 0)) == -1
- || fcntl(s, F_SETFL, flags | O_NONBLOCK) == -1)
+ if (set_cloexec(s) == -1)
goto eexit;
- if (bind(s, &su.sa, sizeof(su)) == -1)
+ if (set_nonblock(s) == -1)
goto eexit;
- if (close_on_exec(s) == -1)
+ if (bind(s, &su.sa, sizeof(su)) == -1)
goto eexit;
#ifdef ENABLE_ARP
if (protocol == ETHERTYPE_ARP)