summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich2015-02-26 15:32:52 -0600
committerNick Kralevich2015-02-26 15:32:52 -0600
commit6d3cddb2e245738f0b78a758a83ebf2608865394 (patch)
treedcbaf1e13e5fd41a46ed2108b2a57b41dd54dbb2 /libnetutils
parentbe9712156bdcf8cff774a78a3afdb0c562998c73 (diff)
downloadplatform-system-core-6d3cddb2e245738f0b78a758a83ebf2608865394.tar.gz
platform-system-core-6d3cddb2e245738f0b78a758a83ebf2608865394.tar.xz
platform-system-core-6d3cddb2e245738f0b78a758a83ebf2608865394.zip
More SOCK_CLOEXEC
Change-Id: I3e18f34d08a6443aaf55d7c91c27867840ac1773
Diffstat (limited to 'libnetutils')
-rw-r--r--libnetutils/ifc_utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index bfe712193..7d2a5fbf2 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -123,7 +123,7 @@ int ifc_init(void)
123{ 123{
124 int ret; 124 int ret;
125 if (ifc_ctl_sock == -1) { 125 if (ifc_ctl_sock == -1) {
126 ifc_ctl_sock = socket(AF_INET, SOCK_DGRAM, 0); 126 ifc_ctl_sock = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
127 if (ifc_ctl_sock < 0) { 127 if (ifc_ctl_sock < 0) {
128 printerr("socket() failed: %s\n", strerror(errno)); 128 printerr("socket() failed: %s\n", strerror(errno));
129 } 129 }
@@ -137,7 +137,7 @@ int ifc_init(void)
137int ifc_init6(void) 137int ifc_init6(void)
138{ 138{
139 if (ifc_ctl_sock6 == -1) { 139 if (ifc_ctl_sock6 == -1) {
140 ifc_ctl_sock6 = socket(AF_INET6, SOCK_DGRAM, 0); 140 ifc_ctl_sock6 = socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0);
141 if (ifc_ctl_sock6 < 0) { 141 if (ifc_ctl_sock6 < 0) {
142 printerr("socket() failed: %s\n", strerror(errno)); 142 printerr("socket() failed: %s\n", strerror(errno));
143 } 143 }
@@ -316,7 +316,7 @@ int ifc_act_on_address(int action, const char *name, const char *address,
316 req.n.nlmsg_len = NLMSG_ALIGN(req.n.nlmsg_len) + RTA_LENGTH(addrlen); 316 req.n.nlmsg_len = NLMSG_ALIGN(req.n.nlmsg_len) + RTA_LENGTH(addrlen);
317 memcpy(RTA_DATA(rta), addr, addrlen); 317 memcpy(RTA_DATA(rta), addr, addrlen);
318 318
319 s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); 319 s = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
320 if (send(s, &req, req.n.nlmsg_len, 0) < 0) { 320 if (send(s, &req, req.n.nlmsg_len, 0) < 0) {
321 close(s); 321 close(s);
322 return -errno; 322 return -errno;