aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/route.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 5d9ca274d149..d82eb1f24b25 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2484,7 +2484,6 @@ static int rt6_fill_node(struct net *net,
2484 struct nlmsghdr *nlh; 2484 struct nlmsghdr *nlh;
2485 long expires; 2485 long expires;
2486 u32 table; 2486 u32 table;
2487 struct neighbour *n;
2488 2487
2489 if (prefix) { /* user wants prefix routes only */ 2488 if (prefix) { /* user wants prefix routes only */
2490 if (!(rt->rt6i_flags & RTF_PREFIX_RT)) { 2489 if (!(rt->rt6i_flags & RTF_PREFIX_RT)) {
@@ -2597,9 +2596,8 @@ static int rt6_fill_node(struct net *net,
2597 if (rtnetlink_put_metrics(skb, dst_metrics_ptr(&rt->dst)) < 0) 2596 if (rtnetlink_put_metrics(skb, dst_metrics_ptr(&rt->dst)) < 0)
2598 goto nla_put_failure; 2597 goto nla_put_failure;
2599 2598
2600 n = rt->n; 2599 if (rt->rt6i_flags & RTF_GATEWAY) {
2601 if (n) { 2600 if (nla_put(skb, RTA_GATEWAY, 16, &rt->rt6i_gateway) < 0)
2602 if (nla_put(skb, RTA_GATEWAY, 16, &n->primary_key) < 0)
2603 goto nla_put_failure; 2601 goto nla_put_failure;
2604 } 2602 }
2605 2603
@@ -2794,7 +2792,6 @@ struct rt6_proc_arg
2794static int rt6_info_route(struct rt6_info *rt, void *p_arg) 2792static int rt6_info_route(struct rt6_info *rt, void *p_arg)
2795{ 2793{
2796 struct seq_file *m = p_arg; 2794 struct seq_file *m = p_arg;
2797 struct neighbour *n;
2798 2795
2799 seq_printf(m, "%pi6 %02x ", &rt->rt6i_dst.addr, rt->rt6i_dst.plen); 2796 seq_printf(m, "%pi6 %02x ", &rt->rt6i_dst.addr, rt->rt6i_dst.plen);
2800 2797
@@ -2803,9 +2800,8 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg)
2803#else 2800#else
2804 seq_puts(m, "00000000000000000000000000000000 00 "); 2801 seq_puts(m, "00000000000000000000000000000000 00 ");
2805#endif 2802#endif
2806 n = rt->n; 2803 if (rt->rt6i_flags & RTF_GATEWAY) {
2807 if (n) { 2804 seq_printf(m, "%pi6", &rt->rt6i_gateway);
2808 seq_printf(m, "%pi6", n->primary_key);
2809 } else { 2805 } else {
2810 seq_puts(m, "00000000000000000000000000000000"); 2806 seq_puts(m, "00000000000000000000000000000000");
2811 } 2807 }