strange bug in ipv6 initscripts, ideas?

Pekka Savola pekkas at netcore.fi
Wed Jul 23 12:42:24 UTC 2003


Hi,

When looking at a bug report in IPv6 initscripts:

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

I came across a very strange bug.  When a command is run from 
interactively, it works fine.  When it's run via hotplug, it bugs under a 
very specific scenario: sometimes when we're redirecting stderr to stdin.

The chain of commands is:

/sbin/ifup eth1
/etc/sysconfig/network-scripts/ifup-ipv6 eth1
  ipv6_add_addr_on_device eth1 fec0::2/64
[in /etc/sysconfig/network-scripts/network-functions-ipv6]
    ipv6_exec_ifconfig eth1 inet6 add fec0::2/64
      LC_ALL=C /sbin/ifconfig eth1 inet6 add fec0::2/64 2>&1
                                                                                
The last fails, for some unknown reason with error code 1 and no output
when run non-interactively; the code fragment in full is:

---8<---
##### Wrapper for used binaries
## ifconfig
# $*: <arguments...>
# return code: result of execution
ipv6_exec_ifconfig() {
        local options=$*
                                                                                
        LC_ALL=C /sbin/ifconfig $options 2>&1
                                                                                
        return $?
}
---8<---
                                                                                
One can work around the issue by removing "2>&1" (again, for whatever
reason?!?).  However, we really shouldn't change that code in the source,
because some functions depend on that to eliminate error messages.
                                                                                
I did a prototype change, and modified the relevant
ipv6_add_addr_on_device:ipv6_exec_ifconfig function to use ipv6_exec_ip; a
similar problem appeared (so, it doesn't seem to be specific to the
application executed).
                                                                                
Any ideas/thoughts?  This seems so weird I'd like some pointers what could 
be wrong here..

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings







More information about the fedora-devel-list mailing list