Loading include/net/neighbour.h +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ enum { NEIGH_VAR_GC_THRESH1, NEIGH_VAR_GC_THRESH2, NEIGH_VAR_GC_THRESH3, NEIGH_VAR_PROBE, NEIGH_VAR_MAX }; Loading net/core/neighbour.c +22 −3 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ static void neigh_update_notify(struct neighbour *neigh, u32 nlmsg_pid); static int pneigh_ifdown_and_unlock(struct neigh_table *tbl, struct net_device *dev); static unsigned int neigh_probe_enable; #ifdef CONFIG_PROC_FS static const struct file_operations neigh_stat_seq_fops; #endif Loading Loading @@ -1308,9 +1309,20 @@ struct neighbour *neigh_event_ns(struct neigh_table *tbl, { struct neighbour *neigh = __neigh_lookup(tbl, saddr, dev, lladdr || !dev->addr_len); if (neigh) if (neigh) { if (neigh_probe_enable) { if (!(neigh->nud_state == NUD_REACHABLE)) { neigh_update(neigh, lladdr, NUD_STALE, NEIGH_UPDATE_F_OVERRIDE, 0); write_lock(&neigh->lock); neigh_probe(neigh); neigh_update_notify(neigh, 0); } } else { neigh_update(neigh, lladdr, NUD_STALE, NEIGH_UPDATE_F_OVERRIDE, 0); } } return neigh; } EXPORT_SYMBOL(neigh_event_ns); Loading Loading @@ -3165,6 +3177,12 @@ static struct neigh_sysctl_table { .extra2 = &int_max, .proc_handler = proc_dointvec_minmax, }, [NEIGH_VAR_PROBE] = { .procname = "neigh_probe", .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }, {}, }, }; Loading Loading @@ -3200,6 +3218,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, t->neigh_vars[NEIGH_VAR_GC_THRESH1].data = &tbl->gc_thresh1; t->neigh_vars[NEIGH_VAR_GC_THRESH2].data = &tbl->gc_thresh2; t->neigh_vars[NEIGH_VAR_GC_THRESH3].data = &tbl->gc_thresh3; t->neigh_vars[NEIGH_VAR_PROBE].data = &neigh_probe_enable; } if (handler) { Loading Loading
include/net/neighbour.h +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ enum { NEIGH_VAR_GC_THRESH1, NEIGH_VAR_GC_THRESH2, NEIGH_VAR_GC_THRESH3, NEIGH_VAR_PROBE, NEIGH_VAR_MAX }; Loading
net/core/neighbour.c +22 −3 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ static void neigh_update_notify(struct neighbour *neigh, u32 nlmsg_pid); static int pneigh_ifdown_and_unlock(struct neigh_table *tbl, struct net_device *dev); static unsigned int neigh_probe_enable; #ifdef CONFIG_PROC_FS static const struct file_operations neigh_stat_seq_fops; #endif Loading Loading @@ -1308,9 +1309,20 @@ struct neighbour *neigh_event_ns(struct neigh_table *tbl, { struct neighbour *neigh = __neigh_lookup(tbl, saddr, dev, lladdr || !dev->addr_len); if (neigh) if (neigh) { if (neigh_probe_enable) { if (!(neigh->nud_state == NUD_REACHABLE)) { neigh_update(neigh, lladdr, NUD_STALE, NEIGH_UPDATE_F_OVERRIDE, 0); write_lock(&neigh->lock); neigh_probe(neigh); neigh_update_notify(neigh, 0); } } else { neigh_update(neigh, lladdr, NUD_STALE, NEIGH_UPDATE_F_OVERRIDE, 0); } } return neigh; } EXPORT_SYMBOL(neigh_event_ns); Loading Loading @@ -3165,6 +3177,12 @@ static struct neigh_sysctl_table { .extra2 = &int_max, .proc_handler = proc_dointvec_minmax, }, [NEIGH_VAR_PROBE] = { .procname = "neigh_probe", .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }, {}, }, }; Loading Loading @@ -3200,6 +3218,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, t->neigh_vars[NEIGH_VAR_GC_THRESH1].data = &tbl->gc_thresh1; t->neigh_vars[NEIGH_VAR_GC_THRESH2].data = &tbl->gc_thresh2; t->neigh_vars[NEIGH_VAR_GC_THRESH3].data = &tbl->gc_thresh3; t->neigh_vars[NEIGH_VAR_PROBE].data = &neigh_probe_enable; } if (handler) { Loading