LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2009, 06:00 AM   #1
quantt
Member
 
Registered: Aug 2008
Posts: 62

Rep: Reputation: 15
Question rawsocket & fork


hi all,
I've idea run daemon from root and bind raw socket, than fork new child from a user !=0 pid and use those socket which I already bind from root.
It's like apache, but it use just socket, when I needs with raw.
Tell me, it would be work or not?
 
Old 04-02-2009, 07:44 AM   #2
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I cannot think of a reason why it would not work. However, why would you want to do this? And why use a raw-socket? A raw-socket should only be used if you plan to configure something in the IP header (e.g. ToS byte).

I've dealt with raw-sockets recently, and I fail to find the "glory" behind them unless there is an absolute need for them. Otherwise, for most applications, a regular socket (TCP or UDP) is just fine.
 
Old 04-02-2009, 08:36 AM   #3
quantt
Member
 
Registered: Aug 2008
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
I've dealt with raw-sockets recently
Did you tried use it from user?
 
Old 04-02-2009, 08:44 PM   #4
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by quantt View Post
Did you tried use it from user?
Yes... and I found out it is not possible to create a raw socket. One must have root-privileges (or the program suid bit set) to create a raw socket.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unsetting router alert(RA) option, when sending through rawsocket sudhir_pandey Linux - Networking 0 11-29-2007 07:55 AM
fork() // parent & child communication sudif Programming 5 05-02-2007 03:11 AM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM
what is the difference between Fork & exec augustus123 Linux - Newbie 1 11-29-2004 07:32 AM
child-parent-&-fork mukul Programming 2 03-24-2001 01:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration