summary refs log tree commit diff
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-19 12:31:33 -0700
committerDavid S. Miller <davem@davemloft.net>2012-07-20 13:31:21 -0700
commitf5b0a8743601a4477419171f5046bd07d1c080a0 (patch)
tree92e17ec293c3d0e35a0deda5d3bbf43710fb96ff /include/net/dst.h
parentf8126f1d5136be1ca1a3536d43ad7a710b5620f8 (diff)
downloadlinux-f5b0a8743601a4477419171f5046bd07d1c080a0.tar.gz
net: Document dst->obsolete better.
Add a big comment explaining how the field works, and use defines
instead of magic constants for the values assigned to it.

Suggested by Joe Perches.

Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 51610468c63d..0df661a0c295 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -65,7 +65,19 @@ struct dst_entry {
 	unsigned short		pending_confirm;
 
 	short			error;
+
+	/* A non-zero value of dst->obsolete forces by-hand validation
+	 * of the route entry.  Positive values are set by the generic
+	 * dst layer to indicate that the entry has been forcefully
+	 * destroyed.
+	 *
+	 * Negative values are used by the implementation layer code to
+	 * force invocation of the dst_ops->check() method.
+	 */
 	short			obsolete;
+#define DST_OBSOLETE_NONE	0
+#define DST_OBSOLETE_DEAD	2
+#define DST_OBSOLETE_FORCE_CHK	-1
 	unsigned short		header_len;	/* more space at head required */
 	unsigned short		trailer_len;	/* space to reserve at tail */
 #ifdef CONFIG_IP_ROUTE_CLASSID
@@ -359,7 +371,7 @@ extern struct dst_entry *dst_destroy(struct dst_entry *dst);
 
 static inline void dst_free(struct dst_entry *dst)
 {
-	if (dst->obsolete > 1)
+	if (dst->obsolete > 0)
 		return;
 	if (!atomic_read(&dst->__refcnt)) {
 		dst = dst_destroy(dst);