diff options
author | Patrick McHardy <kaber@trash.net> | 2007-12-05 04:29:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:56:19 -0500 |
commit | c5de0dfde8b0c5ea3d8b3040db1967f9c1d9748e (patch) | |
tree | 64b8a0e69e9c262b5229d89d37e3dcd9691a8042 /net/netfilter | |
parent | 9872bec773c2e8503fec480c1e8a0c732517e257 (diff) |
[NETFILTER]: nfnetlink_queue: kill useless wrapper
nfqnl_set_mode takes the queue lock and calls __nfqnl_set_mode. Just move
the code from __nfqnl_set_mode to nfqnl_set_mode since there is no other
user.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 449b880042a..37b7655df91 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -176,35 +176,6 @@ __enqueue_entry(struct nfqnl_instance *queue, struct nf_queue_entry *entry) | |||
176 | queue->queue_total++; | 176 | queue->queue_total++; |
177 | } | 177 | } |
178 | 178 | ||
179 | static inline int | ||
180 | __nfqnl_set_mode(struct nfqnl_instance *queue, | ||
181 | unsigned char mode, unsigned int range) | ||
182 | { | ||
183 | int status = 0; | ||
184 | |||
185 | switch (mode) { | ||
186 | case NFQNL_COPY_NONE: | ||
187 | case NFQNL_COPY_META: | ||
188 | queue->copy_mode = mode; | ||
189 | queue->copy_range = 0; | ||
190 | break; | ||
191 | |||
192 | case NFQNL_COPY_PACKET: | ||
193 | queue->copy_mode = mode; | ||
194 | /* we're using struct nlattr which has 16bit nla_len */ | ||
195 | if (range > 0xffff) | ||
196 | queue->copy_range = 0xffff; | ||
197 | else | ||
198 | queue->copy_range = range; | ||
199 | break; | ||
200 | |||
201 | default: | ||
202 | status = -EINVAL; | ||
203 | |||
204 | } | ||
205 | return status; | ||
206 | } | ||
207 | |||
208 | static struct nf_queue_entry * | 179 | static struct nf_queue_entry * |
209 | find_dequeue_entry(struct nfqnl_instance *queue, unsigned int id) | 180 | find_dequeue_entry(struct nfqnl_instance *queue, unsigned int id) |
210 | { | 181 | { |
@@ -540,10 +511,29 @@ static int | |||
540 | nfqnl_set_mode(struct nfqnl_instance *queue, | 511 | nfqnl_set_mode(struct nfqnl_instance *queue, |
541 | unsigned char mode, unsigned int range) | 512 | unsigned char mode, unsigned int range) |
542 | { | 513 | { |
543 | int status; | 514 | int status = 0; |
544 | 515 | ||
545 | spin_lock_bh(&queue->lock); | 516 | spin_lock_bh(&queue->lock); |
546 | status = __nfqnl_set_mode(queue, mode, range); | 517 | switch (mode) { |
518 | case NFQNL_COPY_NONE: | ||
519 | case NFQNL_COPY_META: | ||
520 | queue->copy_mode = mode; | ||
521 | queue->copy_range = 0; | ||
522 | break; | ||
523 | |||
524 | case NFQNL_COPY_PACKET: | ||
525 | queue->copy_mode = mode; | ||
526 | /* we're using struct nlattr which has 16bit nla_len */ | ||
527 | if (range > 0xffff) | ||
528 | queue->copy_range = 0xffff; | ||
529 | else | ||
530 | queue->copy_range = range; | ||
531 | break; | ||
532 | |||
533 | default: | ||
534 | status = -EINVAL; | ||
535 | |||
536 | } | ||
547 | spin_unlock_bh(&queue->lock); | 537 | spin_unlock_bh(&queue->lock); |
548 | 538 | ||
549 | return status; | 539 | return status; |