diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-19 15:31:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-20 16:31:21 -0400 |
commit | f5b0a8743601a4477419171f5046bd07d1c080a0 (patch) | |
tree | 92e17ec293c3d0e35a0deda5d3bbf43710fb96ff /net/ipv4/route.c | |
parent | f8126f1d5136be1ca1a3536d43ad7a710b5620f8 (diff) |
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 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index d1d579638092..50d2498c9284 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1221,7 +1221,7 @@ static void rt_set_nexthop(struct rtable *rt, const struct flowi4 *fl4, | |||
1221 | static struct rtable *rt_dst_alloc(struct net_device *dev, | 1221 | static struct rtable *rt_dst_alloc(struct net_device *dev, |
1222 | bool nopolicy, bool noxfrm) | 1222 | bool nopolicy, bool noxfrm) |
1223 | { | 1223 | { |
1224 | return dst_alloc(&ipv4_dst_ops, dev, 1, -1, | 1224 | return dst_alloc(&ipv4_dst_ops, dev, 1, DST_OBSOLETE_FORCE_CHK, |
1225 | DST_HOST | DST_NOCACHE | | 1225 | DST_HOST | DST_NOCACHE | |
1226 | (nopolicy ? DST_NOPOLICY : 0) | | 1226 | (nopolicy ? DST_NOPOLICY : 0) | |
1227 | (noxfrm ? DST_NOXFRM : 0)); | 1227 | (noxfrm ? DST_NOXFRM : 0)); |
@@ -1969,9 +1969,10 @@ static struct dst_ops ipv4_dst_blackhole_ops = { | |||
1969 | 1969 | ||
1970 | struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig) | 1970 | struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig) |
1971 | { | 1971 | { |
1972 | struct rtable *rt = dst_alloc(&ipv4_dst_blackhole_ops, NULL, 1, 0, 0); | ||
1973 | struct rtable *ort = (struct rtable *) dst_orig; | 1972 | struct rtable *ort = (struct rtable *) dst_orig; |
1973 | struct rtable *rt; | ||
1974 | 1974 | ||
1975 | rt = dst_alloc(&ipv4_dst_blackhole_ops, NULL, 1, DST_OBSOLETE_NONE, 0); | ||
1975 | if (rt) { | 1976 | if (rt) { |
1976 | struct dst_entry *new = &rt->dst; | 1977 | struct dst_entry *new = &rt->dst; |
1977 | 1978 | ||