소스 검색

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>
Marius Tomaschewski 10 년 전
부모
커밋
a394eef562
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      net/ipv6/ndisc.c

+ 5 - 0
net/ipv6/ndisc.c

@@ -1078,6 +1078,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
 	struct ndisc_options ndopts;
 	struct ndisc_options ndopts;
 	int optlen;
 	int optlen;
 	unsigned int pref = 0;
 	unsigned int pref = 0;
+	__u32 old_if_flags;
 
 
 	__u8 *opt = (__u8 *)(ra_msg + 1);
 	__u8 *opt = (__u8 *)(ra_msg + 1);
 
 
@@ -1148,6 +1149,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
 	 * Remember the managed/otherconf flags from most recently
 	 * Remember the managed/otherconf flags from most recently
 	 * received RA message (RFC 2462) -- yoshfuji
 	 * received RA message (RFC 2462) -- yoshfuji
 	 */
 	 */
+	old_if_flags = in6_dev->if_flags;
 	in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED |
 	in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED |
 				IF_RA_OTHERCONF)) |
 				IF_RA_OTHERCONF)) |
 				(ra_msg->icmph.icmp6_addrconf_managed ?
 				(ra_msg->icmph.icmp6_addrconf_managed ?
@@ -1155,6 +1157,9 @@ static void ndisc_router_discovery(struct sk_buff *skb)
 				(ra_msg->icmph.icmp6_addrconf_other ?
 				(ra_msg->icmph.icmp6_addrconf_other ?
 					IF_RA_OTHERCONF : 0);
 					IF_RA_OTHERCONF : 0);
 
 
+	if (old_if_flags != in6_dev->if_flags)
+		inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
+
 	if (!in6_dev->cnf.accept_ra_defrtr) {
 	if (!in6_dev->cnf.accept_ra_defrtr) {
 		ND_PRINTK(2, info,
 		ND_PRINTK(2, info,
 			  "RA: %s, defrtr is false for dev: %s\n",
 			  "RA: %s, defrtr is false for dev: %s\n",