chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
socket: verify socket type properly when desrializing
[elogind.git]
/
src
/
socket-util.c
diff --git
a/src/socket-util.c
b/src/socket-util.c
index 0c9fc9f999e939b1c3fe188ef2b8c51a790433d1..4a1b3d8b515536e97fd0b186ceeed5d8ab276a32 100644
(file)
--- a/
src/socket-util.c
+++ b/
src/socket-util.c
@@
-443,7
+443,7
@@
bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
return true;
}
return true;
}
-bool socket_address_is(const SocketAddress *a, const char *s) {
+bool socket_address_is(const SocketAddress *a, const char *s
, int type
) {
struct SocketAddress b;
assert(a);
struct SocketAddress b;
assert(a);
@@
-452,6
+452,8
@@
bool socket_address_is(const SocketAddress *a, const char *s) {
if (socket_address_parse(&b, s) < 0)
return false;
if (socket_address_parse(&b, s) < 0)
return false;
+ b.type = type;
+
return socket_address_equal(a, &b);
}
return socket_address_equal(a, &b);
}