Skip to content

Commit 8da8646

Browse files
yoshfujidavem330
authored andcommitted
net: neighbour: Add mcast_resolicit to configure the number of multicast resolicitations in PROBE state.
We send unicast neighbor (ARP or NDP) solicitations ucast_probes times in PROBE state. Zhu Yanjun reported that some implementation does not reply against them and the entry will become FAILED, which is undesirable. We had been dealt with such nodes by sending multicast probes mcast_ solicit times after unicast probes in PROBE state. In 2003, I made a change not to send them to improve compatibility with IPv6 NDP. Let's introduce per-protocol per-interface sysctl knob "mcast_ reprobe" to configure the number of multicast (re)solicitation for reconfirmation in PROBE state. The default is 0, since we have been doing so for 10+ years. Reported-by: Zhu Yanjun <Yanjun.Zhu@windriver.com> CC: Ulf Samuelsson <ulf.samuelsson@ericsson.com> Signed-off-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fc300dc commit 8da8646

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

include/net/neighbour.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ enum {
4242
NEIGH_VAR_MCAST_PROBES,
4343
NEIGH_VAR_UCAST_PROBES,
4444
NEIGH_VAR_APP_PROBES,
45+
NEIGH_VAR_MCAST_REPROBES,
4546
NEIGH_VAR_RETRANS_TIME,
4647
NEIGH_VAR_BASE_REACHABLE_TIME,
4748
NEIGH_VAR_DELAY_PROBE_TIME,

include/uapi/linux/neighbour.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ enum {
126126
NDTPA_PROXY_QLEN, /* u32 */
127127
NDTPA_LOCKTIME, /* u64, msecs */
128128
NDTPA_QUEUE_LENBYTES, /* u32 */
129+
NDTPA_MCAST_REPROBES, /* u32 */
129130
__NDTPA_MAX
130131
};
131132
#define NDTPA_MAX (__NDTPA_MAX - 1)

net/core/neighbour.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,9 @@ static void neigh_periodic_work(struct work_struct *work)
817817
static __inline__ int neigh_max_probes(struct neighbour *n)
818818
{
819819
struct neigh_parms *p = n->parms;
820-
int max_probes = NEIGH_VAR(p, UCAST_PROBES) + NEIGH_VAR(p, APP_PROBES);
821-
if (!(n->nud_state & NUD_PROBE))
822-
max_probes += NEIGH_VAR(p, MCAST_PROBES);
823-
return max_probes;
820+
return NEIGH_VAR(p, UCAST_PROBES) + NEIGH_VAR(p, APP_PROBES) +
821+
(n->nud_state & NUD_PROBE ? NEIGH_VAR(p, MCAST_REPROBES) :
822+
NEIGH_VAR(p, MCAST_PROBES));
824823
}
825824

826825
static void neigh_invalidate(struct neighbour *neigh)
@@ -1742,6 +1741,8 @@ static int neightbl_fill_parms(struct sk_buff *skb, struct neigh_parms *parms)
17421741
NEIGH_VAR(parms, UCAST_PROBES)) ||
17431742
nla_put_u32(skb, NDTPA_MCAST_PROBES,
17441743
NEIGH_VAR(parms, MCAST_PROBES)) ||
1744+
nla_put_u32(skb, NDTPA_MCAST_REPROBES,
1745+
NEIGH_VAR(parms, MCAST_REPROBES)) ||
17451746
nla_put_msecs(skb, NDTPA_REACHABLE_TIME, parms->reachable_time) ||
17461747
nla_put_msecs(skb, NDTPA_BASE_REACHABLE_TIME,
17471748
NEIGH_VAR(parms, BASE_REACHABLE_TIME)) ||
@@ -1901,6 +1902,7 @@ static const struct nla_policy nl_ntbl_parm_policy[NDTPA_MAX+1] = {
19011902
[NDTPA_APP_PROBES] = { .type = NLA_U32 },
19021903
[NDTPA_UCAST_PROBES] = { .type = NLA_U32 },
19031904
[NDTPA_MCAST_PROBES] = { .type = NLA_U32 },
1905+
[NDTPA_MCAST_REPROBES] = { .type = NLA_U32 },
19041906
[NDTPA_BASE_REACHABLE_TIME] = { .type = NLA_U64 },
19051907
[NDTPA_GC_STALETIME] = { .type = NLA_U64 },
19061908
[NDTPA_DELAY_PROBE_TIME] = { .type = NLA_U64 },
@@ -2001,6 +2003,10 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh)
20012003
NEIGH_VAR_SET(p, MCAST_PROBES,
20022004
nla_get_u32(tbp[i]));
20032005
break;
2006+
case NDTPA_MCAST_REPROBES:
2007+
NEIGH_VAR_SET(p, MCAST_REPROBES,
2008+
nla_get_u32(tbp[i]));
2009+
break;
20042010
case NDTPA_BASE_REACHABLE_TIME:
20052011
NEIGH_VAR_SET(p, BASE_REACHABLE_TIME,
20062012
nla_get_msecs(tbp[i]));
@@ -2987,6 +2993,7 @@ static struct neigh_sysctl_table {
29872993
NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(MCAST_PROBES, "mcast_solicit"),
29882994
NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(UCAST_PROBES, "ucast_solicit"),
29892995
NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(APP_PROBES, "app_solicit"),
2996+
NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(MCAST_REPROBES, "mcast_resolicit"),
29902997
NEIGH_SYSCTL_USERHZ_JIFFIES_ENTRY(RETRANS_TIME, "retrans_time"),
29912998
NEIGH_SYSCTL_JIFFIES_ENTRY(BASE_REACHABLE_TIME, "base_reachable_time"),
29922999
NEIGH_SYSCTL_JIFFIES_ENTRY(DELAY_PROBE_TIME, "delay_first_probe_time"),

0 commit comments

Comments
 (0)