aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c37
1 files changed, 13 insertions, 24 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e3eab1529633..c86ee3adddcc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2246,7 +2246,6 @@ struct rt6_proc_arg
2246static int rt6_info_route(struct rt6_info *rt, void *p_arg) 2246static int rt6_info_route(struct rt6_info *rt, void *p_arg)
2247{ 2247{
2248 struct rt6_proc_arg *arg = (struct rt6_proc_arg *) p_arg; 2248 struct rt6_proc_arg *arg = (struct rt6_proc_arg *) p_arg;
2249 int i;
2250 2249
2251 if (arg->skip < arg->offset / RT6_INFO_LEN) { 2250 if (arg->skip < arg->offset / RT6_INFO_LEN) {
2252 arg->skip++; 2251 arg->skip++;
@@ -2256,38 +2255,28 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg)
2256 if (arg->len >= arg->length) 2255 if (arg->len >= arg->length)
2257 return 0; 2256 return 0;
2258 2257
2259 for (i=0; i<16; i++) { 2258 arg->len += sprintf(arg->buffer + arg->len,
2260 sprintf(arg->buffer + arg->len, "%02x", 2259 NIP6_SEQFMT " %02x ",
2261 rt->rt6i_dst.addr.s6_addr[i]); 2260 NIP6(rt->rt6i_dst.addr),
2262 arg->len += 2;
2263 }
2264 arg->len += sprintf(arg->buffer + arg->len, " %02x ",
2265 rt->rt6i_dst.plen); 2261 rt->rt6i_dst.plen);
2266 2262
2267#ifdef CONFIG_IPV6_SUBTREES 2263#ifdef CONFIG_IPV6_SUBTREES
2268 for (i=0; i<16; i++) { 2264 arg->len += sprintf(arg->buffer + arg->len,
2269 sprintf(arg->buffer + arg->len, "%02x", 2265 NIP6_SEQFMT " %02x ",
2270 rt->rt6i_src.addr.s6_addr[i]); 2266 NIP6(rt->rt6i_src.addr),
2271 arg->len += 2;
2272 }
2273 arg->len += sprintf(arg->buffer + arg->len, " %02x ",
2274 rt->rt6i_src.plen); 2267 rt->rt6i_src.plen);
2275#else 2268#else
2276 sprintf(arg->buffer + arg->len, 2269 arg->len += sprintf(arg->buffer + arg->len,
2277 "00000000000000000000000000000000 00 "); 2270 "00000000000000000000000000000000 00 ");
2278 arg->len += 36;
2279#endif 2271#endif
2280 2272
2281 if (rt->rt6i_nexthop) { 2273 if (rt->rt6i_nexthop) {
2282 for (i=0; i<16; i++) { 2274 arg->len += sprintf(arg->buffer + arg->len,
2283 sprintf(arg->buffer + arg->len, "%02x", 2275 NIP6_SEQFMT,
2284 rt->rt6i_nexthop->primary_key[i]); 2276 NIP6(*((struct in6_addr *)rt->rt6i_nexthop->primary_key)));
2285 arg->len += 2;
2286 }
2287 } else { 2277 } else {
2288 sprintf(arg->buffer + arg->len, 2278 arg->len += sprintf(arg->buffer + arg->len,
2289 "00000000000000000000000000000000"); 2279 "00000000000000000000000000000000");
2290 arg->len += 32;
2291 } 2280 }
2292 arg->len += sprintf(arg->buffer + arg->len, 2281 arg->len += sprintf(arg->buffer + arg->len,
2293 " %08x %08x %08x %08x %8s\n", 2282 " %08x %08x %08x %08x %8s\n",