aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/iproute2/iproute2/0001-ip-fix-ipv6-ntable-on-ppc64.patch
blob: b5cbf9514e27cf8280143ce2d0c9d84aea10e60d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Upstream-Status: Backport

From a7c2882461581747488e5aabf10d19b46b371a01 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 27 Feb 2013 07:26:17 -0800
Subject: [PATCH] ip: fix ipv6 ntable on ppc64

Add casts to handle printf format when
 sizeof(unsigned long long) != sizeof(__u64)
---
 ip/ipntable.c |   56 +++++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 19 deletions(-)

diff --git a/ip/ipntable.c b/ip/ipntable.c
index 5751114..56ad001 100644
--- a/ip/ipntable.c
+++ b/ip/ipntable.c
@@ -432,7 +432,7 @@ int print_ntable(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 	}
 	if (tb[NDTA_GC_INTERVAL]) {
 		__u64 gc_int = rta_getattr_u64(tb[NDTA_GC_INTERVAL]);
-		fprintf(fp, "gc_int %llu ", gc_int);
+		fprintf(fp, "gc_int %llu ", (unsigned long long) gc_int);
 	}
 
 	if (ret)
@@ -485,15 +485,18 @@ int print_ntable(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 		}
 		if (tpb[NDTPA_REACHABLE_TIME]) {
 			__u64 reachable = rta_getattr_u64(tpb[NDTPA_REACHABLE_TIME]);
-			fprintf(fp, "reachable %llu ", reachable);
+			fprintf(fp, "reachable %llu ",
+				(unsigned long long) reachable);
 		}
 		if (tpb[NDTPA_BASE_REACHABLE_TIME]) {
 			__u64 breachable = rta_getattr_u64(tpb[NDTPA_BASE_REACHABLE_TIME]);
-			fprintf(fp, "base_reachable %llu ", breachable);
+			fprintf(fp, "base_reachable %llu ",
+				(unsigned long long) breachable);
 		}
 		if (tpb[NDTPA_RETRANS_TIME]) {
 			__u64 retrans = rta_getattr_u64(tpb[NDTPA_RETRANS_TIME]);
-			fprintf(fp, "retrans %llu ", retrans);
+			fprintf(fp, "retrans %llu ",
+				(unsigned long long) retrans);
 		}
 
 		fprintf(fp, "%s", _SL_);
@@ -502,11 +505,13 @@ int print_ntable(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 
 		if (tpb[NDTPA_GC_STALETIME]) {
 			__u64 gc_stale = rta_getattr_u64(tpb[NDTPA_GC_STALETIME]);
-			fprintf(fp, "gc_stale %llu ", gc_stale);
+			fprintf(fp, "gc_stale %llu ",
+				(unsigned long long) gc_stale);
 		}
 		if (tpb[NDTPA_DELAY_PROBE_TIME]) {
 			__u64 delay_probe = rta_getattr_u64(tpb[NDTPA_DELAY_PROBE_TIME]);
-			fprintf(fp, "delay_probe %llu ", delay_probe);
+			fprintf(fp, "delay_probe %llu ",
+				(unsigned long long) delay_probe);
 		}
 		if (tpb[NDTPA_QUEUE_LEN]) {
 			__u32 queue = rta_getattr_u32(tpb[NDTPA_QUEUE_LEN]);
@@ -536,11 +541,13 @@ int print_ntable(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 
 		if (tpb[NDTPA_ANYCAST_DELAY]) {
 			__u64 anycast_delay = rta_getattr_u64(tpb[NDTPA_ANYCAST_DELAY]);
-			fprintf(fp, "anycast_delay %llu ", anycast_delay);
+			fprintf(fp, "anycast_delay %llu ",
+				(unsigned long long) anycast_delay);
 		}
 		if (tpb[NDTPA_PROXY_DELAY]) {
 			__u64 proxy_delay = rta_getattr_u64(tpb[NDTPA_PROXY_DELAY]);
-			fprintf(fp, "proxy_delay %llu ", proxy_delay);
+			fprintf(fp, "proxy_delay %llu ",
+				(unsigned long long) proxy_delay);
 		}
 		if (tpb[NDTPA_PROXY_QLEN]) {
 			__u32 pqueue = rta_getattr_u32(tpb[NDTPA_PROXY_QLEN]);
@@ -548,7 +555,8 @@ int print_ntable(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 		}
 		if (tpb[NDTPA_LOCKTIME]) {
 			__u64 locktime = rta_getattr_u64(tpb[NDTPA_LOCKTIME]);
-			fprintf(fp, "locktime %llu ", locktime);
+			fprintf(fp, "locktime %llu ",
+				(unsigned long long) locktime);
 		}
 
 		fprintf(fp, "%s", _SL_);
@@ -560,28 +568,38 @@ int print_ntable(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 		fprintf(fp, "    ");
 		fprintf(fp, "stats ");
 
-		fprintf(fp, "allocs %llu ", ndts->ndts_allocs);
-		fprintf(fp, "destroys %llu ", ndts->ndts_destroys);
-		fprintf(fp, "hash_grows %llu ", ndts->ndts_hash_grows);
+		fprintf(fp, "allocs %llu ",
+			(unsigned long long) ndts->ndts_allocs);
+		fprintf(fp, "destroys %llu ",
+			(unsigned long long) ndts->ndts_destroys);
+		fprintf(fp, "hash_grows %llu ",
+			(unsigned long long) ndts->ndts_hash_grows);
 
 		fprintf(fp, "%s", _SL_);
 		fprintf(fp, "        ");
 
-		fprintf(fp, "res_failed %llu ", ndts->ndts_res_failed);
-		fprintf(fp, "lookups %llu ", ndts->ndts_lookups);
-		fprintf(fp, "hits %llu ", ndts->ndts_hits);
+		fprintf(fp, "res_failed %llu ",
+			(unsigned long long) ndts->ndts_res_failed);
+		fprintf(fp, "lookups %llu ",
+			(unsigned long long) ndts->ndts_lookups);
+		fprintf(fp, "hits %llu ",
+			(unsigned long long) ndts->ndts_hits);
 
 		fprintf(fp, "%s", _SL_);
 		fprintf(fp, "        ");
 
-		fprintf(fp, "rcv_probes_mcast %llu ", ndts->ndts_rcv_probes_mcast);
-		fprintf(fp, "rcv_probes_ucast %llu ", ndts->ndts_rcv_probes_ucast);
+		fprintf(fp, "rcv_probes_mcast %llu ",
+			(unsigned long long) ndts->ndts_rcv_probes_mcast);
+		fprintf(fp, "rcv_probes_ucast %llu ",
+			(unsigned long long) ndts->ndts_rcv_probes_ucast);
 
 		fprintf(fp, "%s", _SL_);
 		fprintf(fp, "        ");
 
-		fprintf(fp, "periodic_gc_runs %llu ", ndts->ndts_periodic_gc_runs);
-		fprintf(fp, "forced_gc_runs %llu ", ndts->ndts_forced_gc_runs);
+		fprintf(fp, "periodic_gc_runs %llu ",
+			(unsigned long long) ndts->ndts_periodic_gc_runs);
+		fprintf(fp, "forced_gc_runs %llu ",
+			(unsigned long long) ndts->ndts_forced_gc_runs);
 
 		fprintf(fp, "%s", _SL_);
 	}
-- 
1.7.9.7