Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 156972 - ifup-routes ignores the last static route line in route-* if file doesn't end with newline
Summary: ifup-routes ignores the last static route line in route-* if file doesn't end...
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 3
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2005-05-05 19:43 UTC by Gabriel Mihaes
Modified: 2014-03-17 02:53 UTC (History)
1 user (show)

Fixed In Version: 8.17-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-10-03 21:06:42 UTC

Attachments (Terms of Use)

Description Gabriel Mihaes 2005-05-05 19:43:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040904 Firefox/0.9.3

Description of problem:
When adding static routes using route-* files, the last line is ignored by ifup-routes if that line doesn't end with a newline character:

From /etc/sysconfig/network-scripts/ifup-routes :
           while read line; do
               /sbin/ip route add $line
           done < "$file"
There's a wrong way for treating the contents of route-* files. A simple example to reproduce the undesired effect:
[root@c0kered tmp]# cat test.txt via via via[root@c0kered tmp]#
[root@c0kered tmp]# while read line; do echo $line; done < test.txt via via
[root@c0kered tmp]#

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

How reproducible:

Steps to Reproduce:
1.Edit /etc/sysconfig/network-scripts/route-eth0
2.EOF should be right at the end of the last line containing a route without being terminated by \n
3.service network restart

Additional info:

Comment 1 Bill Nottingham 2005-10-03 21:06:42 UTC
Fixed in CVS, will be in 8.17-1.

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