diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-26 17:47:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-26 17:47:05 -0500 |
commit | d312c8f81c9810d669cdf13b28f1a5d474738eaf (patch) | |
tree | aa7adbb2bdf84717bc6ac5c0a3bc936b9bc19116 /net/ipv4/fib_trie.c | |
parent | 08eacc3157baf5d14c8e2c4ffc77c13a0ac8a85b (diff) | |
parent | 7399072a7348d025e7bcb5eb5d5e9be941d490b7 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NETFILTER]: nf_conntrack_pptp: fix NAT setup of expected GRE connections
[NETFILTER]: nf_nat_pptp: fix expectation removal
[NETFILTER]: nf_nat: fix ICMP translation with statically linked conntrack
[TCP]: Restore SKB socket owner setting in tcp_transmit_skb().
[AF_PACKET]: Check device down state before hard header callbacks.
[DECNET]: Handle a failure in neigh_parms_alloc (take 2)
[BNX2]: Fix 2nd port's MAC address.
[TCP]: Fix sorting of SACK blocks.
[AF_PACKET]: Fix BPF handling.
[IPV4]: Fix the fib trie iterator to work with a single entry routing tables
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r-- | net/ipv4/fib_trie.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index cfb249cc0a58..13307c04d5a1 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1989,6 +1989,10 @@ static struct node *fib_trie_get_next(struct fib_trie_iter *iter) | |||
1989 | unsigned cindex = iter->index; | 1989 | unsigned cindex = iter->index; |
1990 | struct tnode *p; | 1990 | struct tnode *p; |
1991 | 1991 | ||
1992 | /* A single entry routing table */ | ||
1993 | if (!tn) | ||
1994 | return NULL; | ||
1995 | |||
1992 | pr_debug("get_next iter={node=%p index=%d depth=%d}\n", | 1996 | pr_debug("get_next iter={node=%p index=%d depth=%d}\n", |
1993 | iter->tnode, iter->index, iter->depth); | 1997 | iter->tnode, iter->index, iter->depth); |
1994 | rescan: | 1998 | rescan: |
@@ -2037,11 +2041,18 @@ static struct node *fib_trie_get_first(struct fib_trie_iter *iter, | |||
2037 | if(!iter) | 2041 | if(!iter) |
2038 | return NULL; | 2042 | return NULL; |
2039 | 2043 | ||
2040 | if (n && IS_TNODE(n)) { | 2044 | if (n) { |
2041 | iter->tnode = (struct tnode *) n; | 2045 | if (IS_TNODE(n)) { |
2042 | iter->trie = t; | 2046 | iter->tnode = (struct tnode *) n; |
2043 | iter->index = 0; | 2047 | iter->trie = t; |
2044 | iter->depth = 1; | 2048 | iter->index = 0; |
2049 | iter->depth = 1; | ||
2050 | } else { | ||
2051 | iter->tnode = NULL; | ||
2052 | iter->trie = t; | ||
2053 | iter->index = 0; | ||
2054 | iter->depth = 0; | ||
2055 | } | ||
2045 | return n; | 2056 | return n; |
2046 | } | 2057 | } |
2047 | return NULL; | 2058 | return NULL; |