Questions tagged [socket]

is a data communications endpoint for exchanging data between processes executing within the same host operating system.

100 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
13
votes
0answers
1k views

Sharing unix sockets across unprivileged lxcontainers

I have two unprivileged containers and I'd like to share a unix socket between them. Each container has its own user on the host, complete with separate subuid and subguid mappings. I've tried ...
5
votes
0answers
710 views

Implications of increasing igmp_max_memberships

I am writing an application that will subscribe to 150+ multicast groups. It appears the linux default number of multicast subscriptions is 20 which can be increased via sysctl -w net.ipv4....
5
votes
0answers
831 views

Which socket is gnome-shell reading from continuously?

strace shows that the GNOME shell is continuously trying to read from a socket, which is often not available (or doesn't contain any data to read from): strace -p gnome-shell-pid -e trace=recvfrom ...
3
votes
1answer
1k views

How do I make systemd sockets close when service is stopped?

I'm currently trying to make a systemd service with two Fifo sockets. These sockets map to stdout and stdin of the application. I'm currently using the following configuration files. foo.service [...
3
votes
1answer
2k views

What is the difference between /etc/group and /etc/subgid?

I am in a Docker context and i am using user namespaces to map my container's user into my host's user (let's say foo). As i use portainer (As a container), i need to bind the Docker socket. $ll /var/...
3
votes
0answers
562 views

Is there a way to simulate a socket stuck in CLOSE_WAIT or FIN_WAIT2?

I have a problem that I am trying to hack around where I have lots of local port forwards getting sockets stuck in CLOSE_WAIT and lots of remote port forwards getting sockets stuck in FIN_WAIT2. ...
3
votes
0answers
663 views

When does the kernel cut UDP datagram into MTU chunks?

I need your help/hints/remarks on an issue I'm having. Thanks Here is some context : I have two application(A1 & A2) handling PDUs with a max size of 1700bytes. Each app is on a different card(C1 ...
3
votes
0answers
93 views

Automatically set file group and permissions not by inheriting from a directory

I have set up a webserver daemon on a VPS. This daemon is run by its own service user, named "node". I have already assigned node's home directory a "siteadmin" owning group that I am in, set chmod g+...
3
votes
0answers
1k views

Netlink access inside a network namespace

I'm trying set up an IPsec gateway (strongSwan) on a Raspberry Pi 2. The Pi was already providing a number of services on the LAN using a private IP address. My initial attempt to turn it into an ...
3
votes
0answers
30 views

Limit access/transmit rights on NIC to a single user application

I currently have a RT patched linux machine and I need to have full and undelayed access to my Wired interface card. I am running a realtime non-preemtable user application which sends a couple of ...
3
votes
0answers
580 views

Read but not write access to a socket on Linux, what can one do with that?

On a server installation, I found sockets writable by group, but only readable by others. I assume that the latter has no effect, as my understanding was that write access is needed to be able to work ...
3
votes
0answers
1k views

X11 bad access at first try but working on successive tries

I use the following setup to forward X11 output from my local machine to the server. I will outline the setup: X11 server and the client are on the same local machine. The X11 server runs on my local ...
3
votes
0answers
5k views

Symbolic link to a socket

From a security point of view, is it safe to create a symbolic link to a socket file? The following bits of context refer to the deployment of a web application on a shared hosting service. $ ls -al ~...
3
votes
0answers
875 views

Does epoll give available bytes to read or write, and threshold feature?

kqueue gives available bytes to send or receive if file descriptior (such as socket) gets signal. and, kqueue gives threshold feature, for example, it does not signal until sufficient bytes are ...
2
votes
0answers
27 views

AF_UNIX: Using recv() to receive a message sent with sendmsg()

The function prototype for the sendmsg() function is as follows: ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); and the msghdr struct is such: struct msghdr { void *...
2
votes
0answers
134 views

How to get unix socket inode given its path?

Let /var/run/mysqld/mysqld.sock/ be an open socket. I can stat it to get inode of the file (here 1200) # stat /var/run/mysqld/mysqld.sock File: /var/run/mysqld/mysqld.sock Size: 0 ...
2
votes
0answers
83 views

How to run adb in initramfs?

Seem my hook is work(sometime first run is failed but again run is seem no any library problem), Seem lack socket support in initramfs?my system is debian 9.Seem normal debian system provide socket ...
2
votes
0answers
2k views

How to read from the systemd-journald.socket?

To my understanding systemd-journald creates a couple sockets, where it posts its logging events. # systemctl cat systemd-journald.socket | egrep -v '^ *#' [Unit] Description=Journal Socket ...
2
votes
0answers
277 views

Does SO_ATTACH_FILTER reset the socket's receive buffer?

If a filter is already set and there are unprocessed packets in the sockets receive buffer will calling SO_ATTACH_FILTER to set a new updated filter flush the buffer, i.e is it the same as BSD's ...
2
votes
1answer
557 views

UDP multicast client over ipv6

Simple Python UDP Server: trouble receiving packets from clients other than localhost I am trying to listen datagrams over ipv6. Here are the messages I am interrested in: $ sudo tcpdump | grep ...
2
votes
0answers
200 views

how to list all the epoll requests in linux

I used to use netstat for displaying all listening sockets. How can we list epoll requests on the sockets? Or is there anyway to dislay epoll requests using netstat?
2
votes
0answers
892 views

UDP buffer overrun and old datagram clearing

I am reading UDP datagrams on a linux server at 700,000 per second from HDL32 LIDAR system. Interface is ipv4. Sockets are set to SOREUSADDR. I turn on the LIDAR, start up socket program, it started ...
2
votes
0answers
2k views

What does an inode for a socket contain?

I read somewhere that the inode for a TCP socket would contain the buffer space. Is that true, and if so, does it mean that the inode contains a memory address for the buffer space used by the socket,...
2
votes
0answers
606 views

Emulate console by sending data on one UDP port, and receive text from another

Note: I also posted this question on SuperUser, because I'm not sure where it belongs I'm trying to establish a "console-like" connection with a National Instruments cRIO-FRC. It broadcasts its ...
2
votes
1answer
504 views

Is there a system call to bind a file descriptor directly into another?

A read() & write() loop would probably be as good as what I'm looking for, but nevertheless is anything like that around or is it impossible because of an obstacle I didn't envisage ? I'm curious
2
votes
0answers
144 views

Last data traffic time for a TCP socket

Is it possible, to find out when was the last time there was any traffic on an opened TCP socket? Keepalive and timeout timers are based on this statistic, so I guess it has to be stored somewhere. ...
1
vote
0answers
41 views

socat bidrectionally with a shell script. echo, read, then hand off to socat

There is a VMM which doesn't conform to the the standard VSOCK implementation: Firecracker For each guest it creates a v.sock unix socket file The ordinary VSOCK-CONNECT:cid:1234 then becomes: UNIX-...
1
vote
0answers
15 views

How to create a collecting socket relay with socat?

I'm using socat to forward to another port on localhost: socat tcp-l:5050,fork,reuseaddr tcp:localhost:2020 Problem: if the program running on 2020 is down, socat will answer incoming connections like:...
1
vote
0answers
135 views

How to monitor a UDP specific port/socket?

I have an application that receives UDP packets at port 5000. In order to be 100% sure that the application is receiving all packets (for example the RX buffer could be full and some packets could be ...
1
vote
0answers
34 views

Backward ssh connection via Forward https connection (https-tunnel)

I need a construction that make possible to tunnel backward SSH via forward HTTPS. I tried to draw on a picture what I have to get. The picture shows 4 steps that explain what and how I want to make. ...
1
vote
0answers
64 views

init script that run a socket continuously

I run my script(socket) as daemon with init-script : #!/bin/bash ### BEGIN INIT INFO # Provides: sock_serv # Required-Start: $local_fs $syslog $remote_fs # Required-Stop: $...
1
vote
2answers
723 views

How to create a socket forwarder as a server?

I'm looking for a tool that starts a socket server, and forwards incoming requests on that socket port to another internal one. I found socat is able to forward socket ports in general: socat tcp-l:...
1
vote
0answers
278 views

How to deal efficiently with “Address already in use”?

If I attempt to run my own Python program which listens on a particular port, I may get: socket.error: [Errno 98] Address already in use If the program didn't terminate gracefully. While this may ...
1
vote
0answers
169 views

Linux kernel does not handle orphaned sockets, why not?

This was originally posted to serverfault but was voted as off topic by the community. Let me just preface this question by mentioning I understand the why/how/where/when of the Linux kernel socket ...
1
vote
0answers
577 views

Retrieving the SO_INCOMING_CPU of a UDP Socket?

The socket API provides an SO_INCOMING_CPU option, the details of which are provided in the man page: SO_INCOMING_CPU (gettable since Linux 3.19, settable since Linux 4.4) Sets or gets ...
1
vote
0answers
142 views

Websocket server won't connect if started via PHP

I have a websocket server written in Node. The following instruction, when executed from the command line starts the websocket server successfully: nohup "/root/.nvm/versions/node/v8.11.1/bin/node" "/...
1
vote
0answers
438 views

Increase buffer size of Unix domain datagram socket in systemd unit file

I use Unix domain datagram socket for unidirectional daemon communication. Process writing to the socket may get blocked on write(), at some peaks of computation, because reading process takes more ...
1
vote
0answers
22 views

Regulating user-daemons from listening on unprivileged ports (preventing server spoofing)?

If I have a port >1024 but that I want to reserve to one executable how can I ensure that no other executable can open and listen to a socket on that port? /usr/bin/foo_srv -p 8080 /usr/bin/bar_srv -...
1
vote
0answers
367 views

Bind an existing process to a socket

I want to bind an existing process to a socket listenning on a specific port with nc and send input to it (a python interactive shell, an editor...) whatever process, just send a pid and bind it, ...
1
vote
0answers
111 views

Show bound socket (but not listen) process

I am trying to understand how bind() works. I open a socket, and bind it to port 5001, but I don't execute listen() on it: sockfd = socket(AF_INET, SOCK_STREAM, 0); /* Initialize socket structure */ ...
1
vote
0answers
432 views

Reading MLDv2 queries using an IPv6 socket

I have mrd6 installed on my raspberry pi. It registers with a local interface (tun0) and periodically transmits MLDv2 queries over it. According to [RFC3810], MLDv2 message types are a subset of ...
1
vote
0answers
360 views

Prioritize UDP over FTP, SCP, etc. in Linux

I have a setup wherein one "master" Linux system communicates with 3 "slave" systems also running Linux on a dedicated Ethernet interface(just the master & the 3 slaves). The slaves send data to ...
1
vote
1answer
170 views

Can't forward a TCP socket in a bash script

I have four TCP sockets connected to a device. These are created with exec 3<>/dev/tcp/IP/PORT exec 4<>/dev/tcp/IP/PORT exec 5<>/dev/tcp/IP/PORT exec 6<>/dev/tcp/IP/PORT In ...
1
vote
0answers
1k views

Kill an existing TCP connection quickly

I'm working on a pentesting project, and I have the following setup: I have an SSH daemon that is trying to log all of the activity happening on SSH connections out to another server. I'm trying to ...
1
vote
0answers
196 views

How to get SocketCAN access inside LXC container?

I have an LXC container on an ARM processor using the Yocto toolchain. I have Ethernet working, but I am unable to get SocketCAN access inside the container. Outside the container SocketCAN works ...
1
vote
1answer
341 views

Use systemd on-demand socket activation to start rtl_fm stream

I would like to start rtl_fm on demand for a certain frequency with systemd the moment I connect to a certain port. Example: rtl_fm -f 105000K -M fm -s 170k -A std -l 0 -E deemp -r 44.1k | \ ffmpeg -...
1
vote
0answers
598 views

Is there a way to tune TCP about packet loss and retransmission?

In a question of mine ("Does arbitrary manipulation of TCP connection flow cause problems?") I asked whether a willing delay in a TCP connection could cause some troubles. My HTTP proxy, ...
1
vote
1answer
1k views

Detecting where to bind to receive a UDP broadcast

I'm writing an application that needs to capture and print UDP broadcasts. The network interface in use is: enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.10....
1
vote
0answers
183 views

Port Forwarding, Render Console Warning — Rails v4.2.6

Forwarded port on local router 192.168.1.4:3000 to allow public access w/ my IP address.When viewing my rails app @ http://47.145.229.103:3000/ everything displays correctly, but theres a console ...
1
vote
0answers
376 views

Incoming packet does not delivered to socket

I have a vpn application that connects to vpn server with a tcp socket. I have marked tcp socket packets with setsockopt and SO_MARK. I can ping vpn gateway ping 10.0.0.1 successfully. Then I try to ...