chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #15 from elogind/dev_v229
[elogind.git]
/
src
/
basic
/
socket-util.c
diff --git
a/src/basic/socket-util.c
b/src/basic/socket-util.c
index b2aee389442b7e63b1c95c5d9b52635cb9f1f583..73e19310e065eb2f112d207b13f23221085facf9 100644
(file)
--- a/
src/basic/socket-util.c
+++ b/
src/basic/socket-util.c
@@
-1,5
+1,3
@@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
/***
This file is part of systemd.
/***
This file is part of systemd.
@@
-36,12
+34,12
@@
#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
+#include "log.h"
#include "macro.h"
#include "missing.h"
#include "parse-util.h"
#include "path-util.h"
#include "socket-util.h"
#include "macro.h"
#include "missing.h"
#include "parse-util.h"
#include "path-util.h"
#include "socket-util.h"
-#include "log.h"
#include "string-table.h"
#include "string-util.h"
#include "user-util.h"
#include "string-table.h"
#include "string-util.h"
#include "user-util.h"
@@
-442,17
+440,10
@@
const char* socket_address_get_path(const SocketAddress *a) {
#endif // 0
bool socket_ipv6_is_supported(void) {
#endif // 0
bool socket_ipv6_is_supported(void) {
- _cleanup_free_ char *l = NULL;
-
- if (access("/sys/module/ipv6", F_OK) != 0)
+ if (access("/proc/net/sockstat6", F_OK) != 0)
return false;
return false;
- /* If we can't check "disable" parameter, assume enabled */
- if (read_one_line_file("/sys/module/ipv6/parameters/disable", &l) < 0)
- return true;
-
- /* If module was loaded with disable=1 no IPv6 available */
- return l[0] == '0';
+ return true;
}
#if 0 /// UNNEEDED by elogind
}
#if 0 /// UNNEEDED by elogind
@@
-876,12
+867,19
@@
int getpeersec(int fd, char **ret) {
return 0;
}
return 0;
}
-int send_one_fd(int transport_fd, int fd, int flags) {
+int send_one_fd_sa(
+ int transport_fd,
+ int fd,
+ const struct sockaddr *sa, socklen_t len,
+ int flags) {
+
union {
struct cmsghdr cmsghdr;
uint8_t buf[CMSG_SPACE(sizeof(int))];
} control = {};
struct msghdr mh = {
union {
struct cmsghdr cmsghdr;
uint8_t buf[CMSG_SPACE(sizeof(int))];
} control = {};
struct msghdr mh = {
+ .msg_name = (struct sockaddr*) sa,
+ .msg_namelen = len,
.msg_control = &control,
.msg_controllen = sizeof(control),
};
.msg_control = &control,
.msg_controllen = sizeof(control),
};