Mildly exotic socket related system call problem - anyone help?

David Coffield david at comp.lancs.ac.uk
Mon May 26 01:49:52 AEST 1986


I can never understand people that post incomplete firs

(Bit of humour there).

The problem is this:
in the midst of using sockets I need to get a machine address from
the user e.g. "150.0.0.11" (in that format, as a string) and compare
the network number of that address with the network number of the
address of the machine on which the program is executing.
Should be simple ...

Now about a year ago I discovered that "inet_addr" caused core dumps
every time you called it - so I abandoned it's use and got round the
problem. For what I want to do now I should use its stablemate (RED alert)
"inet_network" but heaven knows what that one's returning.
("inet_ntof" returns the wrong answer but at least it does it
 consistently).

So, questions as follows:
1. Can anyone suggest a way round this problem?
2. Does 4.3 have fixed "inet*" routines??
3. If so can anyone mail me a copy of working ones???
4. Was 3. an illegal question????

The aim of the exercise is merely to validate user input -
if I can't get round it I'll just have to accept possibly ropey input.

Any help much appreciated.

	David
-- 
uucp:   ...!mcvax!ukc!dcl-cs!david     post: Department of Computing
arpa:   david%lancs.comp at ucl.cs              University of Lancaster, UK
janet:  david at uk.ac.lancs.comp         phone: +44 524 65201 x 4599



More information about the Comp.unix.wizards mailing list