public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* missing ipi_spec_dst in struct in_pktinfo
@ 2009-09-04 20:10 Schulman.Andrew
  2009-09-04 21:09 ` Christopher Faylor
  2009-09-05 16:12 ` Corinna Vinschen
  0 siblings, 2 replies; 4+ messages in thread
From: Schulman.Andrew @ 2009-09-04 20:10 UTC (permalink / raw)
  To: cygwin


I'm trying to build socat for Cygwin (1.7).  The build fails with

xio-ip.c:480: error: structure has no member named `ipi_spec_dst'

The offending code wants to use pktinfo->ipi_spec_dst.s_addr, where
pktinfo is a struct in_pktinfo *.  The problem is that in Cygwin,
in_pktinfo doesn't have an ipi_spec_dst member.  The IP man page
(http://homepages.cwi.nl/~aeb/linux/man2html/man7/ip.7.html) lists
in_pktinfo as

struct in_pktinfo {
    unsigned int   ipi_ifindex;  /* Interface index */
    struct in_addr ipi_spec_dst; /* Local address */
    struct in_addr ipi_addr;     /* Header Destination address */
};

while in /usr/include/cygwin/in.h, it's just

struct in_pktinfo
{
  struct in_addr ipi_addr;
  uint32_t       ipi_ifindex;
};

Any suggestions for a workaround to this problem?  Why is ipi_spec_dst
missing, and more to the point, what can/should I substitute in its
place?  ip(7) says that "If ... ipi_spec_dst is not zero, then it is
used as the local source address for the routing table lookup and for
setting up IP source route options."  This suggests that I could replace
it by zero.  Comments?

Thanks,
Andrew.


--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: missing ipi_spec_dst in struct in_pktinfo
  2009-09-04 20:10 missing ipi_spec_dst in struct in_pktinfo Schulman.Andrew
@ 2009-09-04 21:09 ` Christopher Faylor
  2009-09-05 16:12 ` Corinna Vinschen
  1 sibling, 0 replies; 4+ messages in thread
From: Christopher Faylor @ 2009-09-04 21:09 UTC (permalink / raw)
  To: cygwin

On Fri, Sep 04, 2009 at 04:10:24PM -0400, Schulman.Andrew@epamail.epa.gov wrote:
>
>I'm trying to build socat for Cygwin (1.7).  The build fails with
>
>xio-ip.c:480: error: structure has no member named `ipi_spec_dst'
>
>The offending code wants to use pktinfo->ipi_spec_dst.s_addr, where
>pktinfo is a struct in_pktinfo *.  The problem is that in Cygwin,
>in_pktinfo doesn't have an ipi_spec_dst member.  The IP man page
>(http://homepages.cwi.nl/~aeb/linux/man2html/man7/ip.7.html) lists
>in_pktinfo as
>
>struct in_pktinfo {
>    unsigned int   ipi_ifindex;  /* Interface index */
>    struct in_addr ipi_spec_dst; /* Local address */
>    struct in_addr ipi_addr;     /* Header Destination address */
>};
>
>while in /usr/include/cygwin/in.h, it's just
>
>struct in_pktinfo
>{
>  struct in_addr ipi_addr;
>  uint32_t       ipi_ifindex;
>};
>
>Any suggestions for a workaround to this problem?  Why is ipi_spec_dst
>missing, and more to the point, what can/should I substitute in its
>place?  ip(7) says that "If ... ipi_spec_dst is not zero, then it is
>used as the local source address for the routing table lookup and for
>setting up IP source route options."  This suggests that I could replace
>it by zero.  Comments?

The structure isn't used by cygwin in any way so it sounds like you
could replace it with whatever you want.

cgf

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: missing ipi_spec_dst in struct in_pktinfo
  2009-09-04 20:10 missing ipi_spec_dst in struct in_pktinfo Schulman.Andrew
  2009-09-04 21:09 ` Christopher Faylor
@ 2009-09-05 16:12 ` Corinna Vinschen
  2009-09-08 14:38   ` Andrew Schulman
  1 sibling, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2009-09-05 16:12 UTC (permalink / raw)
  To: cygwin

On Sep  4 16:10, Schulman.Andrew@epamail.epa.gov wrote:
> 
> I'm trying to build socat for Cygwin (1.7).  The build fails with
> 
> xio-ip.c:480: error: structure has no member named `ipi_spec_dst'
> 
> The offending code wants to use pktinfo->ipi_spec_dst.s_addr, where
> pktinfo is a struct in_pktinfo *.  The problem is that in Cygwin,
> in_pktinfo doesn't have an ipi_spec_dst member.  The IP man page
> (http://homepages.cwi.nl/~aeb/linux/man2html/man7/ip.7.html) lists
> in_pktinfo as
> 
> struct in_pktinfo {
>     unsigned int   ipi_ifindex;  /* Interface index */
>     struct in_addr ipi_spec_dst; /* Local address */
>     struct in_addr ipi_addr;     /* Header Destination address */
> };
> 
> while in /usr/include/cygwin/in.h, it's just
> 
> struct in_pktinfo
> {
>   struct in_addr ipi_addr;
>   uint32_t       ipi_ifindex;
> };
> 
> Any suggestions for a workaround to this problem?  Why is ipi_spec_dst
> missing, and more to the point, what can/should I substitute in its
> place?

ipi_spec_dst is missing because the Winsock structure in_pktinfo is
defined without this field.  The recvmsg function will return the
Winsock equivalent to this structure, since that's how it gets it from
Windows.  The workaround is easy: Don't use that field.  Disable the code
in socat which uses it.  Even if we would go to great lengths to
add/remove the field when calling WSASendMsg/WSARecvMsg, it would be
entirely meaningless anyway.


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: missing ipi_spec_dst in struct in_pktinfo
  2009-09-05 16:12 ` Corinna Vinschen
@ 2009-09-08 14:38   ` Andrew Schulman
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Schulman @ 2009-09-08 14:38 UTC (permalink / raw)
  To: cygwin

> > The IP man page
> > (http://homepages.cwi.nl/~aeb/linux/man2html/man7/ip.7.html) lists
> > in_pktinfo as
> > 
> > struct in_pktinfo {
> >     unsigned int   ipi_ifindex;  /* Interface index */
> >     struct in_addr ipi_spec_dst; /* Local address */
> >     struct in_addr ipi_addr;     /* Header Destination address */
> > };
> > 
> > while in /usr/include/cygwin/in.h, it's just
> > 
> > struct in_pktinfo
> > {
> >   struct in_addr ipi_addr;
> >   uint32_t       ipi_ifindex;
> > };
> > 
> > Any suggestions for a workaround to this problem?  Why is ipi_spec_dst
> > missing, and more to the point, what can/should I substitute in its
> > place?
> 
> ipi_spec_dst is missing because the Winsock structure in_pktinfo is
> defined without this field.  The recvmsg function will return the
> Winsock equivalent to this structure, since that's how it gets it from
> Windows.  The workaround is easy: Don't use that field.  Disable the code
> in socat which uses it.  Even if we would go to great lengths to
> add/remove the field when calling WSASendMsg/WSARecvMsg, it would be
> entirely meaningless anyway.

OK, thanks to you both.  It turns out that socat only uses that field for
reporting in one place, so I disabled it as you suggested.  socat is great,
I'll be packaging it for Cygwin shortly.  A.

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-08 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-04 20:10 missing ipi_spec_dst in struct in_pktinfo Schulman.Andrew
2009-09-04 21:09 ` Christopher Faylor
2009-09-05 16:12 ` Corinna Vinschen
2009-09-08 14:38   ` Andrew Schulman

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).