Questions tagged [recvmsg]
13 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
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
How to tell when a UDP packet is from the local machine?
I receive a UDP packet using recvmsg(2). I would like to know if it is from the local machine or not.
I can use IP_PKTINFO with recvmsg to get the interface the packet was received on. When the packet was sent to a loopback address this is the…

zrm
- 111
- 2
1
vote
0 answers
Finding sender of multicast UDP packet when using WSARecvMsg
I am attempting to retrieve the ip of the sender of a multicast packet as well as the destination address/interface to which the multicast packet was sent.
When receiving a multicast packet via recvfrom(SOCKET s, char *buf, int len, int flags,…

Alex
- 278
- 1
- 14
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
2 answers
Confirmation that the message was sent to the CAN bus using socketCAN
I would like to confirm that my message has been saved on the CAN bus with socketCAN library.
The socketCAN documentation describes this possibility when using the recvmsg() function, I have problems with its implementation.
The function I want to…

Wojciech Stańczuk
- 13
- 4
0
votes
0 answers
Using flags=0 for revcmsg and sendmsg
What is the expected behaviour of recvmsg/sendmsg when flags=0?
I came across an example in some vsomeip 3.3 code (here for example) that I'm debugging (ported to QNX) and I'm unsure how to interpret this. I even see some SO questions that use 0…

Matt
- 1,928
- 24
- 44
0
votes
0 answers
Parse datagram from recvmsg on a raw socket
I'm trying to parse a datagram obtained with recvmsg on a raw socket, but I'm not sure about its format. Since according to man raw, "A raw socket receives or sends the raw datagram not including link level headers", I was expecting that it would…

Pedro
- 11
- 3
0
votes
0 answers
recvmsg hangs after sending ICMP_ECHO
I'm trying to code a simple version of the ping command.
After I successfully resolve the address of the destination (www.googlg.com in my case),
I send an ICMP_ECHO request to the destination using sendto(2) but in the receiving process the…

Glitch
- 155
- 1
- 9
0
votes
1 answer
How to make recvmsg failed in Linux system
Is there any way how to makes to recvmsg that listen to UDP to return value that smaller than 0?
I can't run code on the system, only send UDP packet.
Edit:
I have tried the @Ben Voigt offer , sending to this port ICMP Port Unreachable packet to…

Kokomelom
- 143
- 1
- 10
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
0 answers
Is it possible to induce recvmsg to return an error?
I'm writing a library that calls recvmsg, and now I'm writing tests for that library. I want to test the error paths: the code that runs when recvmsg returns an error. I could mock out recvmsg but if it's possible I would prefer to test the real…

Drew
- 12,578
- 11
- 58
- 98
-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