diff options
author | Denis Cheng <crquan@gmail.com> | 2007-06-05 03:06:57 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-06-07 16:39:46 -0400 |
commit | c4b1010f406d7c3f819c22a6323c46776d5b148c (patch) | |
tree | a3c9b210cc3def99b38b038c7629292b12deaa37 /net/core | |
parent | c36befb52350fa76bf3cb03d13ba2e17dbe8a508 (diff) |
[NET]: Merge dst_discard_in and dst_discard_out.
Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dst.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 764bccb3d992..c6a05879d58c 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -111,13 +111,7 @@ out: | |||
111 | spin_unlock(&dst_lock); | 111 | spin_unlock(&dst_lock); |
112 | } | 112 | } |
113 | 113 | ||
114 | static int dst_discard_in(struct sk_buff *skb) | 114 | static int dst_discard(struct sk_buff *skb) |
115 | { | ||
116 | kfree_skb(skb); | ||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | static int dst_discard_out(struct sk_buff *skb) | ||
121 | { | 115 | { |
122 | kfree_skb(skb); | 116 | kfree_skb(skb); |
123 | return 0; | 117 | return 0; |
@@ -138,8 +132,7 @@ void * dst_alloc(struct dst_ops * ops) | |||
138 | dst->ops = ops; | 132 | dst->ops = ops; |
139 | dst->lastuse = jiffies; | 133 | dst->lastuse = jiffies; |
140 | dst->path = dst; | 134 | dst->path = dst; |
141 | dst->input = dst_discard_in; | 135 | dst->input = dst->output = dst_discard; |
142 | dst->output = dst_discard_out; | ||
143 | #if RT_CACHE_DEBUG >= 2 | 136 | #if RT_CACHE_DEBUG >= 2 |
144 | atomic_inc(&dst_total); | 137 | atomic_inc(&dst_total); |
145 | #endif | 138 | #endif |
@@ -153,8 +146,7 @@ static void ___dst_free(struct dst_entry * dst) | |||
153 | protocol module is unloaded. | 146 | protocol module is unloaded. |
154 | */ | 147 | */ |
155 | if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) { | 148 | if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) { |
156 | dst->input = dst_discard_in; | 149 | dst->input = dst->output = dst_discard; |
157 | dst->output = dst_discard_out; | ||
158 | } | 150 | } |
159 | dst->obsolete = 2; | 151 | dst->obsolete = 2; |
160 | } | 152 | } |
@@ -242,8 +234,7 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev, | |||
242 | return; | 234 | return; |
243 | 235 | ||
244 | if (!unregister) { | 236 | if (!unregister) { |
245 | dst->input = dst_discard_in; | 237 | dst->input = dst->output = dst_discard; |
246 | dst->output = dst_discard_out; | ||
247 | } else { | 238 | } else { |
248 | dst->dev = &loopback_dev; | 239 | dst->dev = &loopback_dev; |
249 | dev_hold(&loopback_dev); | 240 | dev_hold(&loopback_dev); |