Bug 494849 - [RHEL5] Wrong order of the addresses in the routing header returned by use inet6_rth_reverse()
[RHEL5] Wrong order of the addresses in the routing header returned by use in...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc (Show other bugs)
5.3
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jakub Jelinek
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-08 07:10 EDT by Olivier Fourdan
Modified: 2016-11-24 10:51 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 07:45:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
reproducer program (2.01 KB, text/plain)
2009-04-08 07:10 EDT, Olivier Fourdan
no flags Details
Proposed patch (632 bytes, patch)
2009-04-08 07:20 EDT, Olivier Fourdan
no flags Details | Diff

  None (edit)
Description Olivier Fourdan 2009-04-08 07:10:10 EDT
Created attachment 338691 [details]
reproducer program

Description of problem:

The returned order of the addresses in the routing header is wrong as returned by inet6_rth_reverse().

When using inet6_rth_reverse() to reverse an routing header, glibc should return an routing header which addresses have been reversed as per RFC 3542:

 RFC 3542
 7.4.  inet6_rth_reverse

     int inet6_rth_reverse(const void *in, void *out);

   This function takes a Routing header extension header (pointed to by
   the first argument) and writes a new Routing header that sends
   datagrams along the reverse of that route.  The function reverses the
   order of the addresses and sets the segleft member in the new Routing
   header to the number of segments.  Both arguments are allowed to
   point to the same buffer (that is, the reversal can occur in place).

   The return value of the function is 0 on success, or -1 upon an
   error.

Version-Release number of selected component (if applicable):

glibc-2.5-34

How reproducible:

100% reproducible

Steps to Reproduce:
1. Compile the reproducer program provided by our customer:

   gcc -o router-14 router-14.c

2. Run program

   ./router-14

Actual results:

inet6_rth_init()
routing header is:
00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
inet6_rth_add() : ret 0
routing header is:
00 04 00 01 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
inet6_rth_add() : ret 0
routing header is:
00 04 00 02 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
inet6_rth_reverse()
routing header is:
00 04 00 02 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
ERROR: the address in Routing Header is incorrect

Expected results:


inet6_rth_init()
routing header is:
00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
inet6_rth_add() : ret 0
routing header is:
00 04 00 01 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
inet6_rth_add() : ret 0
routing header is:
00 04 00 02 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
inet6_rth_reverse()
routing header is:
00 04 00 02 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 01

Additional info:

This is bug #9880:

    http://sources.redhat.com/bugzilla/show_bug.cgi?id=9880

Current upstream CVS of glibc have the fix applied.
Comment 1 Olivier Fourdan 2009-04-08 07:20:30 EDT
Created attachment 338692 [details]
Proposed patch

Patch proposed by our customer.
Comment 2 Jakub Jelinek 2009-04-10 06:55:28 EDT
2009-03-15  Ulrich Drepper  <drepper@redhat.com>

        [BZ #9880]
        * inet/inet6_rth.c (inet6_rth_reverse): Compute number of segments
        correctly.  Set segleft member in output as required.
        Patch partly by Yang Hongyang <yanghy@cn.fujitsu.com>.
        * inet/tst-inet6_rth.c (do_test): Add tests for inet6_rth_reverse.
Comment 6 Chris Ward 2009-07-03 14:29:30 EDT
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.
Comment 9 errata-xmlrpc 2009-09-02 07:45:32 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1415.html

Note You need to log in before you can comment on or make changes to this bug.