* getsockopt error ( trying to build mtr )
@ 1998-03-31 5:00 Robert Sparks
1998-04-02 5:00 ` Robert Sparks
0 siblings, 1 reply; 2+ messages in thread
From: Robert Sparks @ 1998-03-31 5:00 UTC (permalink / raw)
I am trying to get mtr (http://www.mkimball.org/mtr.html)
running on a DU 3.2c system. It fails as distributed. The
following short program exercises the error that is killing
it off. When run (as root of course), setsockopt returns -1
and errno is set to EACCES. What is messed up here?
Has anyone else gotten mtr to go on 3.2 or 4.0?
RjS
-----------------------------------------------------------
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
main()
{
int sock;
int rval;
int hop=1;
sock = socket(AF_INET,SOCK_RAW,IPPROTO_ICMP);
if (sock==-1) {perror("socket");}
rval = setsockopt(sock,IPPROTO_IP,IP_TTL,(char*)&hop,sizeof(hop));
if (rval==-1) {perror("setsockopt");}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: getsockopt error ( trying to build mtr )
1998-03-31 5:00 getsockopt error ( trying to build mtr ) Robert Sparks
@ 1998-04-02 5:00 ` Robert Sparks
0 siblings, 0 replies; 2+ messages in thread
From: Robert Sparks @ 1998-04-02 5:00 UTC (permalink / raw)
I succeeded in porting mtr to Digital Unix 3.2c - I'm sending
the changes to Matt Kimball.
Basically I had to build the IP headers by hand instead
of using setsockopt to set TTL.
I still don't know why the short program in my previous
post does not run correctly. Any insights would be appreciated.
RjS
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-04-02 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-03-31 5:00 getsockopt error ( trying to build mtr ) Robert Sparks
1998-04-02 5:00 ` Robert Sparks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox