patch for icmp.h

Charles Wilson
Wed Mar 30 19:25:00 GMT 2011

On 3/30/2011 2:37 PM, John Paul Morrison wrote:
> This patch adds missing icmp types and definitions needs for source
> compatibility, and it seems to work for raw icmp sockets.
> My only changes is renaming __USE_BSD which is used by Linux. It doesn't
> look like cygwin has an equivalent and didn't want to add a potentially
> conflicting #define. The other option would be removing the #ifdef
> completely.
> I understand that raw/icmp sockets may be undocumented in Windows;
> Cygwin and/or windows and/or the myping.c test program may be buggy etc.
> The test program was able to put a valid ICMP echo request on the wire
> with correct ip and icmp headers in the correct endianness , so at least
> some raw socket functions are working

Well, they will only work in general on XP32 and older, not XP64, Vista,
or newer -- as you need admin rights to muck with raw or icmp sockets on
those OSs.

It's interesting this comes up now. Recently there was another thread
concerning ICMP:
Especially Corinna's reply:
> Still, if you think you can make use of the tool anyway, try to fetch
> the netinet/ip6.h and netinet/icmp6.h headers from FreeBSD.  Both

That advice works here, too: if you want to add stuff to cygwin, you're
better off using BSD sources instead of GPLed ones (see below).

There was also some talk concerning w32api support for icmp
functionality, which may (or may not) be relevant:

> --- snap/usr/include/cygwin/icmp.h    2011-03-27 12:31:43.000000000 -0700
> +++ /usr/include/cygwin/icmp.h    2011-03-28 16:02:20.842491500 -0700
> @@ -1 +1,291 @@
>  /* icmp.h */
> +
> +
> +/* Copyright (C) 1991, 92, 93, 95, 96, 97, 99 Free Software Foundation,
> Inc.
> +   This file is part of the GNU C Library.

If you're trying to add something to cygwin, it has to be copyright
assignable to Red Hat or available under a non-copyleft license (like
BSD) -- because otherwise Red Hat can't add (a) release it commercially,
nor (b) add the section 10(?) "other open source licenses" exception.
Since this patch is directly copied from GNU C, to which you do not own
the rights, you can't then assign them to Red Hat.  So, this patch, in
this form, can't be accepted (if I'm wrong, I'm sure Corinna or cgf will
correct me -- but I don't think I am).

And in any case, you'll need to fill out a copyright assignment
yourself, for any contribution of this size.


More information about the Cygwin-patches mailing list