public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: mtr under cygwin
Date: Thu, 11 Mar 2010 10:20:00 -0000	[thread overview]
Message-ID: <20100311100402.GF6505@calimero.vinschen.de> (raw)
In-Reply-To: <81aa6b5a1003101524i30177381te6906ea8cccfe386@mail.gmail.com>

On Mar 10 18:24, Brian Minton wrote:
> I'm having the same issue.  I just tried it with mtr 0.75 under cygwin
> 1.7.1 and it is still not working.
> 
> On Wed, Jan 21, 2009 at 5:55 PM, David Arnstein <arnstein@panix.com> wrote:
> > I am able to compile mtr 0.75 under Cygwin, see
> > http://www.bitwizard.nl/mtr/.
> >
> > But mtr is not working. Using ddd, I see that the call
> >        getsockname (recvsock, name, &len);
> >
> > does not seem to be filling in name correctly, when recvsock=3. It
> > fills in name->sa_family = 0.
> >
> > Any suggestions?

Did socket creation succeed?  mtr uses raw sockets and those can only be
created by admin users since XP.  Since Vista, you must also run the
application in an elevated shell.  I just tested to create such a socket
and getsockname works fine for me:

  bash$ cat > sockname.c <<EOF
  #include <stdio.h>
  #include <string.h>
  #include <errno.h>
  #include <sys/socket.h>

  int
  main (int argc, char **argv)
  {
    int fd;
    int ret;
    int val;
    socklen_t siz;
    struct sockaddr sa;

    fd = socket(AF_INET, SOCK_RAW, 0);
    if (fd >= 0)
      {
	ret = getsockname (fd, &sa, (siz = sizeof sa, &siz));
	if (!ret)
	  printf ("family: %d\n", sa.sa_family);
	else
	  printf ("errno: %d (%s)\n", errno, strerror (errno));
	close (fd);
      }
    return 0;
  }
  EOF
  bash$ gcc -o sockname sockname.c
  bash$ ./sockname
  family: 2


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      reply	other threads:[~2010-03-11 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22  3:30 David Arnstein
2009-01-22 11:43 ` Corinna Vinschen
2010-03-10 23:36 ` Brian Minton
2010-03-11 10:20   ` Corinna Vinschen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100311100402.GF6505@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).