Initial commit: Uploaded everything from abs/core
[arch-rock.git] / support / iproute / vpnc-routing.patch
blob04e70d98a99729bf8f319c9b74ac4592e6dafb23
1 Subject: [PATCH] Route metrics decode bug.
2 Array was not being offset correctly.
4 See http://bugs.archlinux.org/task/5669
6 Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
7 ---
8 ip/iproute.c | 10 ++++------
9 1 files changed, 4 insertions(+), 6 deletions(-)
11 diff --git a/ip/iproute.c b/ip/iproute.c
12 index 24e7a86..16c398a 100644
13 --- a/ip/iproute.c
14 +++ b/ip/iproute.c
15 @@ -142,7 +142,7 @@ int print_route(const struct sockaddr_nl
16 static int ip6_multiple_tables;
17 __u32 table;
18 SPRINT_BUF(b1);
20 + static int hz;
22 if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) {
23 fprintf(stderr, "Not a route: %08x %08x %08x\n",
24 @@ -446,7 +446,6 @@ #endif
25 fprintf(fp, "%s%x> ", first ? "<" : "", flags);
26 if (tb[RTA_CACHEINFO]) {
27 struct rta_cacheinfo *ci = RTA_DATA(tb[RTA_CACHEINFO]);
28 - static int hz;
29 if (!hz)
30 hz = get_user_hz();
31 if (ci->rta_expires != 0)
32 @@ -473,7 +472,6 @@ #endif
33 if (tb[RTA_CACHEINFO])
34 ci = RTA_DATA(tb[RTA_CACHEINFO]);
35 if ((r->rtm_flags & RTM_F_CLONED) || (ci && ci->rta_expires)) {
36 - static int hz;
37 if (!hz)
38 hz = get_user_hz();
39 if (r->rtm_flags & RTM_F_CLONED)
40 @@ -506,13 +504,13 @@ #endif
41 mxlock = *(unsigned*)RTA_DATA(mxrta[RTAX_LOCK]);
43 for (i=2; i<= RTAX_MAX; i++) {
44 - static int hz;
45 if (mxrta[i] == NULL)
46 continue;
47 if (!hz)
48 hz = get_hz();
49 - if (i-2 < sizeof(mx_names)/sizeof(char*))
50 - fprintf(fp, " %s", mx_names[i-2]);
52 + if (i < sizeof(mx_names)/sizeof(char*) && mx_names[i])
53 + fprintf(fp, " %s", mx_names[i]);
54 else
55 fprintf(fp, " metric %d", i);
56 if (mxlock & (1<<i))