diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-27 16:52:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-27 16:52:16 -0500 |
commit | 144001bddcb4db62c2261f1d703d835851031577 (patch) | |
tree | e10cd1840542b2a6d4873ff8477314d91e453881 /include | |
parent | 606598237c856b0c6584c2263288657658140da9 (diff) |
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')
-rw-r--r-- | include/net/inetpeer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 2af0c63d3975..61f2c66edb2a 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -51,6 +51,13 @@ struct inet_peer { | |||
51 | 51 | ||
52 | void inet_initpeers(void) __init; | 52 | void inet_initpeers(void) __init; |
53 | 53 | ||
54 | #define INETPEER_METRICS_NEW (~(u32) 0) | ||
55 | |||
56 | static inline bool inet_metrics_new(const struct inet_peer *p) | ||
57 | { | ||
58 | return p->metrics[RTAX_LOCK-1] == INETPEER_METRICS_NEW; | ||
59 | } | ||
60 | |||
54 | /* can be called with or without local BH being disabled */ | 61 | /* can be called with or without local BH being disabled */ |
55 | struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create); | 62 | struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create); |
56 | 63 | ||