View Bug Activity | Format For Printing
In file inet/inet6_opt.c: inet6_opt_init (void *extbuf, socklen_t extlen) What the method should do is written in RFC 3542. I tried to set up a hop-by-hop options header but got errors back from sendmsg(). My findings are as follows: RFC 2460 says for HbH Opts and Dest Opts: Hdr Ext Len 8-bit unsigned integer. Length of the Hop-by Hop Options header in 8-octet units, not including the first 8 octets. The problem is now that inet6_opt_init(extbuf, extlen) with extlen == 8 results in a wrong setting of the extension header length, because the glibc code sets extp->ip6h_len = extlen / 8; which yields 1, but it should be actually 0! Passing an extlen of 0 is not allowed by the sanity checks of the method and the RFC requires a _positive_ multiple of 8. So constructing a valid IPv6 HbH Opt Extension header is not possible using the current implementation of inet6_opt_init(). Fix: extp->ip6h_len = extlen / 8 - 1;
Created an attachment (id=2255) Proposed fix for the bug. Fixing the bug is easy
Applied to the trunk.