~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/decnet/dn_table.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
};
60
60
 
61
61
#define dz_key_0(key)           ((key).datum = 0)
62
 
#define dz_prefix(key,dz)       ((key).datum)
63
62
 
64
63
#define for_nexthops(fi) { int nhsel; const struct dn_fib_nh *nh;\
65
64
        for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++)
124
123
                                   struct dn_fib_node **old_ht,
125
124
                                   int old_divisor)
126
125
{
127
 
        int i;
128
126
        struct dn_fib_node *f, **fp, *next;
 
127
        int i;
129
128
 
130
129
        for(i = 0; i < old_divisor; i++) {
131
 
                for(f = old_ht[i]; f; f = f->fn_next) {
 
130
                for(f = old_ht[i]; f; f = next) {
132
131
                        next = f->fn_next;
133
132
                        for(fp = dn_chain_p(f->fn_key, dz);
134
133
                                *fp && dn_key_leq((*fp)->fn_key, f->fn_key);
765
764
        return found;
766
765
}
767
766
 
768
 
static int dn_fib_table_lookup(struct dn_fib_table *tb, const struct flowi *flp, struct dn_fib_res *res)
 
767
static int dn_fib_table_lookup(struct dn_fib_table *tb, const struct flowidn *flp, struct dn_fib_res *res)
769
768
{
770
769
        int err;
771
770
        struct dn_zone *dz;
774
773
        read_lock(&dn_fib_tables_lock);
775
774
        for(dz = t->dh_zone_list; dz; dz = dz->dz_next) {
776
775
                struct dn_fib_node *f;
777
 
                dn_fib_key_t k = dz_key(flp->fld_dst, dz);
 
776
                dn_fib_key_t k = dz_key(flp->daddr, dz);
778
777
 
779
778
                for(f = dz_chain(k, dz); f; f = f->fn_next) {
780
779
                        if (!dn_key_eq(k, f->fn_key)) {
789
788
                        if (f->fn_state&DN_S_ZOMBIE)
790
789
                                continue;
791
790
 
792
 
                        if (f->fn_scope < flp->fld_scope)
 
791
                        if (f->fn_scope < flp->flowidn_scope)
793
792
                                continue;
794
793
 
795
794
                        err = dn_fib_semantic_match(f->fn_type, DN_FIB_INFO(f), flp, res);