aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ndisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r--net/ipv6/ndisc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index cb8856b1d951..e17116796059 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1019,7 +1019,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1019 struct ra_msg *ra_msg = (struct ra_msg *) skb->h.raw; 1019 struct ra_msg *ra_msg = (struct ra_msg *) skb->h.raw;
1020 struct neighbour *neigh = NULL; 1020 struct neighbour *neigh = NULL;
1021 struct inet6_dev *in6_dev; 1021 struct inet6_dev *in6_dev;
1022 struct rt6_info *rt; 1022 struct rt6_info *rt = NULL;
1023 int lifetime; 1023 int lifetime;
1024 struct ndisc_options ndopts; 1024 struct ndisc_options ndopts;
1025 int optlen; 1025 int optlen;
@@ -1081,6 +1081,9 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1081 (ra_msg->icmph.icmp6_addrconf_other ? 1081 (ra_msg->icmph.icmp6_addrconf_other ?
1082 IF_RA_OTHERCONF : 0); 1082 IF_RA_OTHERCONF : 0);
1083 1083
1084 if (!in6_dev->cnf.accept_ra_defrtr)
1085 goto skip_defrtr;
1086
1084 lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime); 1087 lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime);
1085 1088
1086 rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); 1089 rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev);
@@ -1128,6 +1131,8 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1128 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = ra_msg->icmph.icmp6_hop_limit; 1131 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = ra_msg->icmph.icmp6_hop_limit;
1129 } 1132 }
1130 1133
1134skip_defrtr:
1135
1131 /* 1136 /*
1132 * Update Reachable Time and Retrans Timer 1137 * Update Reachable Time and Retrans Timer
1133 */ 1138 */