netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fw: [Bugme-new] [Bug 7665] New: getsockopt(IPV6_*CAST_HOPS) returns -1
@ 2006-12-11 17:56 Andrew Morton
  2006-12-11 21:55 ` Brian Haley
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2006-12-11 17:56 UTC (permalink / raw)
  To: netdev



Begin forwarded message:

Date: Mon, 11 Dec 2006 07:18:20 -0800
From: bugme-daemon@bugzilla.kernel.org
To: bugme-new@lists.osdl.org
Subject: [Bugme-new] [Bug 7665] New: getsockopt(IPV6_*CAST_HOPS) returns -1


http://bugzilla.kernel.org/show_bug.cgi?id=7665

           Summary: getsockopt(IPV6_*CAST_HOPS) returns -1
    Kernel Version: 2.6.19
            Status: NEW
          Severity: normal
             Owner: yoshfuji@linux-ipv6.org
         Submitter: rdenis@simphalempin.com


Most recent kernel where this bug did *NOT* occur: N/A
Distribution: Debian Sid
Hardware Environment: i386
Software Environment: glibc 2.3.6
Problem Description:

Where fd is a socket (datagram or raw) with IPv6 protocol family,
getsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, ...) succeeds, but the returned 
hop limit is -1. connect()'ing the socket first does not solve the problem.

Same problem with IPV6_MULTICAST_HOPS.

Steps to reproduce:

Compile and run the following test case:

#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

int main (void)
{
        int fd, val;
        socklen_t len = sizeof (val);
        struct sockaddr_in6 addr;

        memset (&addr, 0, sizeof (addr));
        fd = socket (AF_INET6, SOCK_RAW, IPPROTO_UDP);
        addr.sin6_family = AF_INET6;
        addr.sin6_addr.s6_addr[15] = 1;
        connect (fd, (struct sockaddr *)&addr, sizeof (addr));

        if (fd == -1) return 1;
        if (getsockopt (fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &val, &len) == 0)
                printf ("Default unicast hops limit: %d\n", val);
        if (getsockopt (fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &val, &len) == 
0)
                printf ("Default multicast hops limit: %d\n", val);
        return 0;
}

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

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

end of thread, other threads:[~2006-12-13 17:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-11 17:56 Fw: [Bugme-new] [Bug 7665] New: getsockopt(IPV6_*CAST_HOPS) returns -1 Andrew Morton
2006-12-11 21:55 ` Brian Haley
2006-12-12  8:08   ` Rémi Denis-Courmont
2006-12-12 21:16     ` Brian Haley
2006-12-12 22:38       ` Rémi Denis-Courmont
2006-12-13  1:11       ` David Miller
2006-12-13 17:28         ` Brian Haley

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 NNTP newsgroup(s).