Bug 494849

Summary: [RHEL5] Wrong order of the addresses in the routing header returned by use inet6_rth_reverse()
Product: Red Hat Enterprise Linux 5 Reporter: Olivier Fourdan <ofourdan>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: cward, drepper, fweimer, kem, pmuller, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 11:45:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
reproducer program
none
Proposed patch none

Description Olivier Fourdan 2009-04-08 11:10:10 UTC
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 11:20:30 UTC
Created attachment 338692 [details]
Proposed patch

Patch proposed by our customer.

Comment 2 Jakub Jelinek 2009-04-10 10:55:28 UTC
2009-03-15  Ulrich Drepper  <drepper>

        [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.com>.
        * inet/tst-inet6_rth.c (do_test): Add tests for inet6_rth_reverse.

Comment 6 Chris Ward 2009-07-03 18:29:30 UTC
~~ 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 11:45:32 UTC
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