Questions tagged [sendmsg]
11 questions
3
votes
1 answer
Can I pass a TCP socket resource via socket_sendmsg (sendmsg) to a AF_UNIX local socket and if so how
My goal is to pass along a socket connection (once 'handshaken' (http upgraded) and 'authenticated' (my own function that does a challenge using the provided details against my db))to another php script process (not forked) so that it can add it to…

Ryan Barrett
- 101
- 3
- 9
1
vote
0 answers
Send 'Enter' key to window not active via NirCmd
Dear coding enthusiasts,
In the last year I got to know the remarkable commandline tool NirCmd. With that I realized many functions on a single shortcut such as muting microphone, setting volume to predefined level, and many more. So when I need to…

Andreas Hanisch
- 21
- 1
1
vote
1 answer
iov and msg_control in sendmsg and recvmsg
What is the difference between iov.iov_base and msg.msg_control ?
I'm looking at some code examples (ipuitls open source ping)
When sending data using sendmsg the packet is set in iov.iov_base
When reading data using recvmsg the packet is read from…

User121212
- 35
- 5
1
vote
0 answers
Use the same struct msghdr object between sendmsg and recvmsg in Netlink
I have some code snippet where I send then receive message through netlink API.
//...
struct msghdr msg = {0};
//...
// some other structures initialization
msg.msg_name = &sa;
msg.msg_namelen = sizeof sa;
msg.msg_iov = &iov;
…

z0lupka
- 236
- 4
- 19
1
vote
1 answer
How to get values for ipi_ifindex for sendmsg()?
Using sendmsg() it is possible to specify from which interface a datagram will be sent, if a value is set for in_pktinfo.ipi_ifindex.
If the packet is a response to a datagram received with recvmsg() I can get the interface value from there.
If I…

fadedbee
- 42,671
- 44
- 178
- 308
0
votes
0 answers
sendmsg() with Unix domain socket blocks forever on Mac with specific sizes
I'm sending messages on Unix domain sockets on Mac with sendmsg(). However, it sometimes hangs forever.
I've called getsockopt(socket, SOL_SOCKET, SO_SNDBUF, ...) to get the size of the send buffer. (The default is 2048).
If I try sending a message…

IanPudney
- 5,941
- 1
- 24
- 39
0
votes
1 answer
Passing multiple buffers with iovec in C Linux sockets
I'm writing a linux C client-server programs that communicates with each other with unix domain sockets and passes couple of buffers each time.
I'm using ioverctors but for some reasons the server program only receives the first io vector.
Any idea…

Linuxuser0221
- 15
- 2
0
votes
2 answers
sendmsg() / connect() fails with permission error/EACCES on raw IPv6 socket
I try to get a program running on OpenWRT (kernel ver.: 4.14.215, musl libc ver.: 1.1.24) which implements RFC8157 (a new tunneling protocol). Unfortunately the guy who wrote it doesn't seem to maintain it anymore.
At some point it writes its first…

user8614223
- 1
- 3
0
votes
1 answer
c sockets sendmsg MSG_DONTWAIT - buffer reuse
I'm using C Sockets to send ICMP packets with the MSG_DONTWAIT flag set.
My program is single threaded but it expected to send messages at high frequency so I'm setting the message send as non blocking.
Is it safe to share/modify/reuse the message…

User121212
- 35
- 5
0
votes
0 answers
Sending file descriptors from Unix Sockets
I am using the Linux sendmsg() function to send a file-descriptor to another process over a Unix Socket along with some data payload. I make multiple calls to sendmsg. In the recvmsg() companion call inside the destination process, I get the file…

westocl
- 73
- 6
-1
votes
1 answer
how to use sendmsg() system call in server client program
I'm going through sendmsg systemcall, i want to trigger this sendmsg systemcall using a server client programs and what to use ftrace to trace what functions are involved and understand the flow of sendmsg

mittu
- 1
- 2