[iproute/f13/master] printf() __u32 fix to solve possible negative metric output

Petr Sabata psabata at fedoraproject.org
Tue Sep 21 08:40:58 UTC 2010


commit a77b926facdd099e1fa65ecd90491c762fbc8e21
Author: Petr Sabata <psabata at redhat.com>
Date:   Tue Sep 21 10:40:08 2010 +0200

    printf() __u32 fix to solve possible negative metric output

 iproute.spec                   |    7 ++++++-
 iproute2-print-route-u32.patch |   20 ++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/iproute.spec b/iproute.spec
index b4a5613..406557e 100644
--- a/iproute.spec
+++ b/iproute.spec
@@ -4,7 +4,7 @@
 Summary: Advanced IP routing and network device configuration tools
 Name: iproute
 Version: 2.6.33
-Release: 3%{?dist}
+Release: 4%{?dist}
 Group: Applications/System
 ##Source: iproute2-%{date_version}.tar.bz2
 Source: http://developer.osdl.org/dev/iproute2/download/iproute2-%{version}.tar.bz2
@@ -17,6 +17,7 @@ Patch4: iproute2-sharepath.patch
 Patch5: iproute2-2.6.31-tc_modules.patch
 Patch6: iproute2-2.6.29-IPPROTO_IP_for_SA.patch
 Patch7: iproute2-example-cbq-service.patch
+Patch8: iproute2-print-route-u32.patch
 
 License: GPLv2+ and Public Domain
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -49,6 +50,7 @@ The iproute documentation contains howtos and examples of settings.
 %patch5 -p1 -b .ipt
 %patch6 -p1 -b .ipproto
 %patch7 -p1 -b .fix_cbq
+%patch8 -p1 -b .print-route-u32
 
 %build
 export LIBDIR=/%{_libdir}
@@ -128,6 +130,9 @@ EOF
 %doc RELNOTES
 
 %changelog
+* Tue Aug 31 2010 Petr Sabata <psabata at redhat.com> - 2.6.33-4
+- Route metric print patch, iproute2-print-route-u32.patch
+
 * Wed Jul 07 2010 Petr Sabata <psabata at redhat.com> - 2.6.33-3
 - Requires: iptables >= 1.4.5, BuildRequires: iptables-devel >= 1.4.5
 
diff --git a/iproute2-print-route-u32.patch b/iproute2-print-route-u32.patch
new file mode 100644
index 0000000..48920d8
--- /dev/null
+++ b/iproute2-print-route-u32.patch
@@ -0,0 +1,20 @@
+--- iproute2-2.6.35/ip/iproute.c	2010-08-31 13:01:39.151185561 +0200
++++ iproute2-print-route-u32.c	    2010-08-31 13:41:04.072928779 +0200
+@@ -368,7 +368,7 @@
+ 				    abuf, sizeof(abuf)));
+ 	}
+ 	if (tb[RTA_PRIORITY])
+-		fprintf(fp, " metric %d ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
++		fprintf(fp, " metric %u ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
+ 	if (r->rtm_flags & RTNH_F_DEAD)
+ 		fprintf(fp, "dead ");
+ 	if (r->rtm_flags & RTNH_F_ONLINK)
+@@ -487,7 +487,7 @@
+ 			if (i < sizeof(mx_names)/sizeof(char*) && mx_names[i])
+ 				fprintf(fp, " %s", mx_names[i]);
+ 			else
+-				fprintf(fp, " metric %d", i);
++				fprintf(fp, " metric %u", i);
+ 			if (mxlock & (1<<i))
+ 				fprintf(fp, " lock");
+ 


More information about the scm-commits mailing list