Solved

select(2)'ing a datagram socket

Posted on 2002-07-26
2
616 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

20 Experts available now in Live!

Get 1:1 Help Now