aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Tomaschewski <mt@suse.de>2015-08-31 09:59:22 -0400
committerDavid S. Miller <davem@davemloft.net>2015-08-31 18:13:08 -0400
commita394eef562d781f37a50d99cf1dfe596dc1ed96d (patch)
treebacf21e376e9ed12c117cbcb09767ef55777501f
parent684511ac2eeb015b7a9a46c575543566e1b1fb7c (diff)
ipv6: send NEWLINK on RA managed/otherconf changes
The kernel is applying the RA managed/otherconf flags silently and forgets to send ifinfo notify to inform about their change when the router provides a zero reachable_time and retrans_timer as dnsmasq and many routers send it, which just means unspecified by this router and the host should continue using whatever value it is already using. Userspace may monitor the ifinfo notifications to activate dhcpv6. Signed-off-by: Marius Tomaschewski <mt@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/ndisc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 13d3c2beb93e..12fff091e043 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1078,6 +1078,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1078 struct ndisc_options ndopts; 1078 struct ndisc_options ndopts;
1079 int optlen; 1079 int optlen;
1080 unsigned int pref = 0; 1080 unsigned int pref = 0;
1081 __u32 old_if_flags;
1081 1082
1082 __u8 *opt = (__u8 *)(ra_msg + 1); 1083 __u8 *opt = (__u8 *)(ra_msg + 1);
1083 1084
@@ -1148,6 +1149,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1148 * Remember the managed/otherconf flags from most recently 1149 * Remember the managed/otherconf flags from most recently
1149 * received RA message (RFC 2462) -- yoshfuji 1150 * received RA message (RFC 2462) -- yoshfuji
1150 */ 1151 */
1152 old_if_flags = in6_dev->if_flags;
1151 in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED | 1153 in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED |
1152 IF_RA_OTHERCONF)) | 1154 IF_RA_OTHERCONF)) |
1153 (ra_msg->icmph.icmp6_addrconf_managed ? 1155 (ra_msg->icmph.icmp6_addrconf_managed ?
@@ -1155,6 +1157,9 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1155 (ra_msg->icmph.icmp6_addrconf_other ? 1157 (ra_msg->icmph.icmp6_addrconf_other ?
1156 IF_RA_OTHERCONF : 0); 1158 IF_RA_OTHERCONF : 0);
1157 1159
1160 if (old_if_flags != in6_dev->if_flags)
1161 inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
1162
1158 if (!in6_dev->cnf.accept_ra_defrtr) { 1163 if (!in6_dev->cnf.accept_ra_defrtr) {
1159 ND_PRINTK(2, info, 1164 ND_PRINTK(2, info,
1160 "RA: %s, defrtr is false for dev: %s\n", 1165 "RA: %s, defrtr is false for dev: %s\n",