Skip to content

Commit 2053aeb

Browse files
mtomaschewskidavem330
authored andcommitted
ipv6: send only one NEWLINK when RA causes changes
Signed-off-by: Marius Tomaschewski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c42858e commit 2053aeb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

net/ipv6/ndisc.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
10791079
int optlen;
10801080
unsigned int pref = 0;
10811081
__u32 old_if_flags;
1082+
bool send_ifinfo_notify = false;
10821083

10831084
__u8 *opt = (__u8 *)(ra_msg + 1);
10841085

@@ -1158,7 +1159,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
11581159
IF_RA_OTHERCONF : 0);
11591160

11601161
if (old_if_flags != in6_dev->if_flags)
1161-
inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
1162+
send_ifinfo_notify = true;
11621163

11631164
if (!in6_dev->cnf.accept_ra_defrtr) {
11641165
ND_PRINTK(2, info,
@@ -1261,7 +1262,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
12611262
rtime = HZ/10;
12621263
NEIGH_VAR_SET(in6_dev->nd_parms, RETRANS_TIME, rtime);
12631264
in6_dev->tstamp = jiffies;
1264-
inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
1265+
send_ifinfo_notify = true;
12651266
}
12661267

12671268
rtime = ntohl(ra_msg->reachable_time);
@@ -1278,11 +1279,17 @@ static void ndisc_router_discovery(struct sk_buff *skb)
12781279
GC_STALETIME, 3 * rtime);
12791280
in6_dev->nd_parms->reachable_time = neigh_rand_reach_time(rtime);
12801281
in6_dev->tstamp = jiffies;
1281-
inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
1282+
send_ifinfo_notify = true;
12821283
}
12831284
}
12841285
}
12851286

1287+
/*
1288+
* Send a notify if RA changed managed/otherconf flags or timer settings
1289+
*/
1290+
if (send_ifinfo_notify)
1291+
inet6_ifinfo_notify(RTM_NEWLINK, in6_dev);
1292+
12861293
skip_linkparms:
12871294

12881295
/*

0 commit comments

Comments
 (0)