summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2005-03-09 05:22:32 -0800
committerDavid S. Miller <davem@northbeach.davemloft.net.davemloft.net>2005-03-09 05:22:32 -0800
commit6a1b925ddace110c6f91df7df0c725faba63d8ab (patch)
tree705e9328f59133aea85b51166df3bd97ccaa0562
parent87f3a4c3798949e96c28a9e2bc5f7bb7a7b12001 (diff)
[NEIGH]: Provide number of probes to userspace
Provides number of probes done so far to userspace, quite useful for debugging. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--net/core/neighbour.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 3f5f66cc738f..d93abe3c9faa 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -446,6 +446,7 @@ enum
NDA_DST,
NDA_LLADDR,
NDA_CACHEINFO,
+ NDA_PROBES,
__NDA_MAX
};
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 8b673c03a3cb..9eb332e495c9 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1554,6 +1554,7 @@ static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n,
unsigned char *b = skb->tail;
struct nda_cacheinfo ci;
int locked = 0;
+ u32 probes;
struct nlmsghdr *nlh = NLMSG_PUT(skb, pid, seq, event,
sizeof(struct ndmsg));
struct ndmsg *ndm = NLMSG_DATA(nlh);
@@ -1573,9 +1574,11 @@ static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n,
ci.ndm_confirmed = now - n->confirmed;
ci.ndm_updated = now - n->updated;
ci.ndm_refcnt = atomic_read(&n->refcnt) - 1;
+ probes = atomic_read(&n->probes);
read_unlock_bh(&n->lock);
locked = 0;
RTA_PUT(skb, NDA_CACHEINFO, sizeof(ci), &ci);
+ RTA_PUT(skb, NDA_PROBES, sizeof(probes), &probes);
nlh->nlmsg_len = skb->tail - b;
return skb->len;