Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: send only one NEWLINK when RA causes changes

Signed-off-by: Marius Tomaschewski <mt@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Marius Tomaschewski and committed by
David S. Miller
2053aeb6 c42858ea

+10 -3
+10 -3
net/ipv6/ndisc.c
··· 1079 1079 int optlen; 1080 1080 unsigned int pref = 0; 1081 1081 __u32 old_if_flags; 1082 + bool send_ifinfo_notify = false; 1082 1083 1083 1084 __u8 *opt = (__u8 *)(ra_msg + 1); 1084 1085 ··· 1159 1158 IF_RA_OTHERCONF : 0); 1160 1159 1161 1160 if (old_if_flags != in6_dev->if_flags) 1162 - inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); 1161 + send_ifinfo_notify = true; 1163 1162 1164 1163 if (!in6_dev->cnf.accept_ra_defrtr) { 1165 1164 ND_PRINTK(2, info, ··· 1262 1261 rtime = HZ/10; 1263 1262 NEIGH_VAR_SET(in6_dev->nd_parms, RETRANS_TIME, rtime); 1264 1263 in6_dev->tstamp = jiffies; 1265 - inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); 1264 + send_ifinfo_notify = true; 1266 1265 } 1267 1266 1268 1267 rtime = ntohl(ra_msg->reachable_time); ··· 1279 1278 GC_STALETIME, 3 * rtime); 1280 1279 in6_dev->nd_parms->reachable_time = neigh_rand_reach_time(rtime); 1281 1280 in6_dev->tstamp = jiffies; 1282 - inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); 1281 + send_ifinfo_notify = true; 1283 1282 } 1284 1283 } 1285 1284 } 1285 + 1286 + /* 1287 + * Send a notify if RA changed managed/otherconf flags or timer settings 1288 + */ 1289 + if (send_ifinfo_notify) 1290 + inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); 1286 1291 1287 1292 skip_linkparms: 1288 1293