On Mon, Jan 14, 2013 at 12:25:37AM +0100, Pablo Neira Ayuso wrote:

Hi,

this appears to be only half of the fix.

> -     hints.ai_socktype = type;
> -     hints.ai_flags = 0;
> -     hints.ai_protocol = proto;
> +     if (type == SOCK_RAW) {
> +             /* Workaround for glibc, that returns EAI_SERVICE (-8) if
> +              * SOCK_RAW and IPPROTO_GRE is used.
> +              */
> +             hints.ai_socktype = SOCK_DGRAM;
> +             hints.ai_protocol = IPPROTO_UDP;
> +     } else {
> +             hints.ai_socktype = type;
> +             hints.ai_protocol = proto;
> +     }


now rp->ai_socktype will be SOCK_DGRAM and rp->ai_protocol UDP. So the 'raw'
socket for GRE will be a datagram socket for UDP.

E.g. you need the second hunk from my workaround[1]. I just wondered if you
could think about a better way (one that can be easily dumped or ifdefed
without putting the special case in the middle).

holger


[1] 
https://build.opensuse.org/package/view_file?expand=1&file=raw-socket.patch&package=libosmocore&project=home%3Azecke23

Reply via email to