diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-02 05:21:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-05 04:03:06 -0400 |
commit | 5110effee8fde2edfacac9cd12a9960ab2dc39ea (patch) | |
tree | f74fff97af20ffdf805fedc56f0c8f88bbef2df7 /net/core | |
parent | 60d354ebebd9d0f760cb6c3b9f53a7ade0f8cd0e (diff) |
net: Do delayed neigh confirmation.
When a dst_confirm() happens, mark the confirmation as pending in the
dst. Then on the next packet out, when we have the neigh in-hand, do
the update.
This removes the dependency in dst_confirm() of dst's having an
attached neigh.
While we're here, remove the explicit 'dst' NULL check, all except 2
or 3 call sites ensure it's not NULL. So just fix those cases up.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dst.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 43d94cedbf7c..a6e19a23a745 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -152,7 +152,7 @@ EXPORT_SYMBOL(dst_discard); | |||
152 | const u32 dst_default_metrics[RTAX_MAX]; | 152 | const u32 dst_default_metrics[RTAX_MAX]; |
153 | 153 | ||
154 | void *dst_alloc(struct dst_ops *ops, struct net_device *dev, | 154 | void *dst_alloc(struct dst_ops *ops, struct net_device *dev, |
155 | int initial_ref, int initial_obsolete, int flags) | 155 | int initial_ref, int initial_obsolete, unsigned short flags) |
156 | { | 156 | { |
157 | struct dst_entry *dst; | 157 | struct dst_entry *dst; |
158 | 158 | ||
@@ -188,6 +188,7 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev, | |||
188 | dst->__use = 0; | 188 | dst->__use = 0; |
189 | dst->lastuse = jiffies; | 189 | dst->lastuse = jiffies; |
190 | dst->flags = flags; | 190 | dst->flags = flags; |
191 | dst->pending_confirm = 0; | ||
191 | dst->next = NULL; | 192 | dst->next = NULL; |
192 | if (!(flags & DST_NOCOUNT)) | 193 | if (!(flags & DST_NOCOUNT)) |
193 | dst_entries_add(ops, 1); | 194 | dst_entries_add(ops, 1); |