summaryrefslogtreecommitdiffstats
path: root/include/net/inetpeer.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-01-27 13:52:16 -0800
committerDavid S. Miller <davem@davemloft.net>2011-01-27 13:52:16 -0800
commit144001bddcb4db62c2261f1d703d835851031577 (patch)
treee10cd1840542b2a6d4873ff8477314d91e453881 /include/net/inetpeer.h
parent606598237c856b0c6584c2263288657658140da9 (diff)
downloadop-kernel-dev-144001bddcb4db62c2261f1d703d835851031577.zip
op-kernel-dev-144001bddcb4db62c2261f1d703d835851031577.tar.gz
inetpeer: Mark metrics as "new" in fresh inetpeer entries.
Set the RTAX_LOCKED metric to INETPEER_METRICS_NEW (basically, all ones) on fresh inetpeer entries. This way code can determine if default metrics have been loaded in from a routing table entry already. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inetpeer.h')
-rw-r--r--include/net/inetpeer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 2af0c63..61f2c66 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -51,6 +51,13 @@ struct inet_peer {
void inet_initpeers(void) __init;
+#define INETPEER_METRICS_NEW (~(u32) 0)
+
+static inline bool inet_metrics_new(const struct inet_peer *p)
+{
+ return p->metrics[RTAX_LOCK-1] == INETPEER_METRICS_NEW;
+}
+
/* can be called with or without local BH being disabled */
struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create);
OpenPOWER on IntegriCloud