Solved

select(2)'ing a datagram socket

Posted on 2002-07-26
2
622 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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 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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

707 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