Bug 66263 - RFE: check_default_route() much too slow
Summary: RFE: check_default_route() much too slow
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.3
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
: 53530 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-06-06 21:30 UTC by Dan Hollis
Modified: 2014-03-17 02:27 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-06-12 07:13:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Hollis 2002-06-06 21:30:31 UTC
Description of Problem:
The check_default_route() in /etc/sysconfig/network-scripts/network-functions is too slow.

It takes the output of 'ip route' and greps it for default route:

check_default_route ()
{
   LC_ALL=C ip route | grep -q default
}

Instead it should be:

check_default_route ()
{
  LC_ALL=C ip route list match 0/0 | grep -q default
}

By using 'list match' to find a default route, the function runs about 20-50 times faster.

This is important on boxes with many hundreds of thousands of bgp routes.
 
find_gateway_dev () can probably be optimized in similar fashion.

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


How Reproducible:
Every time

Steps to Reproduce:
1. install <a href="http://www.zebra.org">zebra</a>
2. get a bgp feed of several 100,000's routes
3. ctrl-alt-del to shutdown

Actual Results:
very slow shutdown

Expected Results:
should shutdown much faster

Additional Information:

Comment 1 Florian La Roche 2002-07-16 13:30:32 UTC
I have made this change in the newest initscripts package.

Thanks,

Florian La Roche


Comment 2 Bill Nottingham 2003-10-06 05:34:46 UTC
*** Bug 53530 has been marked as a duplicate of this bug. ***


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