public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/9880] New: fix the total number of ip addrs in Router Header type 0 in inet6_rth_reverse()
@ 2009-02-23  7:35 yanghy at cn dot fujitsu dot com
  2009-03-15 20:23 ` [Bug libc/9880] " drepper at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: yanghy at cn dot fujitsu dot com @ 2009-02-23  7:35 UTC (permalink / raw)
  To: glibc-bugs

The inet6_rth_reverse() is used to reverse the order of the addresses
in the new Routing header, but the total number of ip addrs is miscalculated.

The initial value of segment left is equal to the value of
"ip6r0_len * 8 / sizeof (struct in6_addr)", and the segment left
will decrease to zero until the packet reach the destination.

So, the total ip addrs is equal to "ip6r0_len * 8 / sizeof (struct in6_addr)",
not "ip6r0_segleft * 8 / sizeof (struct in6_addr)" or "ip6r0_segleft".

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>


--- glibc-2.5-20061008T1257.org/inet/inet6_rth.c	2009-01-11 22:51:33.000000000 +0800
+++ glibc-2.5-20061008T1257/inet/inet6_rth.c	2009-01-11 23:15:23.000000000 +0800
@@ -127,7 +127,7 @@ inet6_rth_reverse (const void *in, void 
       /* Copy header, not the addresses.  The memory regions can overlap.  */
       memmove (out_rthdr0, in_rthdr0, sizeof (struct ip6_rthdr0));
 
-      int total = in_rthdr0->ip6r0_segleft * 8 / sizeof (struct in6_addr);
+      int total = in_rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr);
       for (int i = 0; i < total / 2; ++i)
 	{
 	  /* Remember, IN_RTHDR0 and OUT_RTHDR0 might overlap.  */

-- 
           Summary: fix the total number of ip addrs in Router Header type 0
                    in inet6_rth_reverse()
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: yanghy at cn dot fujitsu dot com
                CC: glibc-bugs at sources dot redhat dot com,yanghy at cn
                    dot fujitsu dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=9880

------- 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] 2+ messages in thread

* [Bug libc/9880] fix the total number of ip addrs in Router Header type 0 in inet6_rth_reverse()
  2009-02-23  7:35 [Bug libc/9880] New: fix the total number of ip addrs in Router Header type 0 in inet6_rth_reverse() yanghy at cn dot fujitsu dot com
@ 2009-03-15 20:23 ` drepper at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: drepper at redhat dot com @ 2009-03-15 20:23 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2009-03-15 20:23 -------
I've checked in this change and fixed one additional problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=9880

------- 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] 2+ messages in thread

end of thread, other threads:[~2009-03-15 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-23  7:35 [Bug libc/9880] New: fix the total number of ip addrs in Router Header type 0 in inet6_rth_reverse() yanghy at cn dot fujitsu dot com
2009-03-15 20:23 ` [Bug libc/9880] " drepper at redhat dot com

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