aboutsummaryrefslogtreecommitdiff
path: root/src/util/network.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-09 20:16:52 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-09 20:16:52 +0000
commitd36a5863ee8d8f440934f93969da167cb383f4c7 (patch)
tree17d9540d0de3f99feae37f16423c033e75414723 /src/util/network.c
parentbc28ff95e287a6794890c75348075fa9bd7af2f7 (diff)
downloadgnunet-d36a5863ee8d8f440934f93969da167cb383f4c7.tar.gz
gnunet-d36a5863ee8d8f440934f93969da167cb383f4c7.zip
removing remenants of abstract unix domain socket handling, this finishes addressing #2887
Diffstat (limited to 'src/util/network.c')
-rw-r--r--src/util/network.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/util/network.c b/src/util/network.c
index 03dfcddd6..fdc15e0d4 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -393,23 +393,6 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
393 socklen_t address_len) 393 socklen_t address_len)
394{ 394{
395 int ret; 395 int ret;
396 socklen_t bind_address_len = address_len;
397
398#ifdef LINUX
399 if (AF_UNIX == address->sa_family)
400 {
401 const struct sockaddr_un *address_un = (const struct sockaddr_un *)address;
402 if (address_un->sun_path[0] == '\0')
403 {
404 bind_address_len = \
405 sizeof (struct sockaddr_un) \
406 - sizeof (address_un->sun_path) \
407 + strnlen (address_un->sun_path + 1, sizeof (address_un->sun_path) - 1) \
408 + 1;
409 GNUNET_break (0);
410 }
411 }
412#endif
413 396
414#ifdef IPV6_V6ONLY 397#ifdef IPV6_V6ONLY
415#ifdef IPPROTO_IPV6 398#ifdef IPPROTO_IPV6
@@ -444,7 +427,7 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
444 old_mask = umask (S_IWGRP | S_IRGRP | S_IXGRP | S_IWOTH | S_IROTH | S_IXOTH); 427 old_mask = umask (S_IWGRP | S_IRGRP | S_IXGRP | S_IWOTH | S_IROTH | S_IXOTH);
445#endif 428#endif
446 429
447 ret = bind (desc->fd, address, bind_address_len); 430 ret = bind (desc->fd, address, address_len);
448#ifndef WINDOWS 431#ifndef WINDOWS
449 if (AF_UNIX == address->sa_family) 432 if (AF_UNIX == address->sa_family)
450 (void) umask (old_mask); 433 (void) umask (old_mask);
@@ -564,21 +547,6 @@ GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
564{ 547{
565 int ret; 548 int ret;
566 549
567#ifdef LINUX
568 if (address->sa_family == AF_UNIX)
569 {
570 const struct sockaddr_un *address_un = (const struct sockaddr_un *)address;
571 if (address_un->sun_path[0] == '\0')
572 {
573 address_len = \
574 sizeof (struct sockaddr_un) \
575 - sizeof (address_un->sun_path) \
576 + strnlen (address_un->sun_path + 1, sizeof (address_un->sun_path) - 1) \
577 + 1;
578 GNUNET_break (0);
579 }
580 }
581#endif
582 ret = connect (desc->fd, address, address_len); 550 ret = connect (desc->fd, address, address_len);
583 551
584#ifdef MINGW 552#ifdef MINGW
@@ -803,18 +771,6 @@ GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle * desc,
803#ifdef MSG_NOSIGNAL 771#ifdef MSG_NOSIGNAL
804 flags |= MSG_NOSIGNAL; 772 flags |= MSG_NOSIGNAL;
805#endif 773#endif
806#ifdef LINUX
807 if (dest_addr->sa_family == AF_UNIX)
808 {
809 const struct sockaddr_un *dest_addr_un = (const struct sockaddr_un *)dest_addr;
810 if (dest_addr_un->sun_path[0] == '\0')
811 dest_len = \
812 sizeof (struct sockaddr_un) \
813 - sizeof (dest_addr_un->sun_path) \
814 + strnlen (dest_addr_un->sun_path + 1, sizeof (dest_addr_un->sun_path) - 1) \
815 + 1;
816 }
817#endif
818 ret = sendto (desc->fd, message, length, flags, dest_addr, dest_len); 774 ret = sendto (desc->fd, message, length, flags, dest_addr, dest_len);
819#ifdef MINGW 775#ifdef MINGW
820 if (SOCKET_ERROR == ret) 776 if (SOCKET_ERROR == ret)