Solved

select(2)'ing a datagram socket

Posted on 2002-07-26
2
615 Views
Last Modified: 2012-06-27
See title... it doesnt seem to work (linux 2.4.18)
Strace looks like:

socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 8
setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(8, {sin_family=AF_INET, sin_port=htons(1029), sin_addr=inet_addr("0.0.0.0")}}, 16) = 0
fcntl64(8, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
select(9, [3 4 5 6 7 8], [], [], {1, 0}) = 1 (in [8], left {0, 220000})
getsockopt(8, SOL_IP, 0x50 /* IP_??? */, 0xbffff65c, 0xbffff648) = -1 ENOPROTOOPT (Protocol not available)
close(8)                                = 0
select(9, [3 4 5 6 7 8], [], [], {1, 0}) = -1 EBADF (Bad file descriptor)

My question is: Is this at all possible? If yes, how (what options)? If no, how should i do this considering i'm already select()'ing tcp ports (which works fine). Is there a generic way (for both stream and dgram) to do this?
0
Comment
Question by:m00
2 Comments
 

Author Comment

by:m00
ID: 7180905
Oops, its not the select() of course, the problem is getsockopt.. maybe somebody can give me a clue why
getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, sa, salen) wouldnt work there then.. :/
datagram socket have a destination surely?
0
 
LVL 5

Accepted Solution

by:
bryanh earned 300 total points
ID: 7181258
> datagram socket have a destination surely?

No, that's what it means to be a datagram socket.  You can send to anywhere at any time through it (or receive from anywhere at any time through it).
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now