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

« back to all changes in this revision

Viewing changes to net/decnet/dn_fib.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:
201
201
        int err;
202
202
 
203
203
        if (nh->nh_gw) {
204
 
                struct flowi fl;
 
204
                struct flowidn fld;
205
205
                struct dn_fib_res res;
206
206
 
207
207
                if (nh->nh_flags&RTNH_F_ONLINK) {
221
221
                        return 0;
222
222
                }
223
223
 
224
 
                memset(&fl, 0, sizeof(fl));
225
 
                fl.fld_dst = nh->nh_gw;
226
 
                fl.oif = nh->nh_oif;
227
 
                fl.fld_scope = r->rtm_scope + 1;
228
 
 
229
 
                if (fl.fld_scope < RT_SCOPE_LINK)
230
 
                        fl.fld_scope = RT_SCOPE_LINK;
231
 
 
232
 
                if ((err = dn_fib_lookup(&fl, &res)) != 0)
 
224
                memset(&fld, 0, sizeof(fld));
 
225
                fld.daddr = nh->nh_gw;
 
226
                fld.flowidn_oif = nh->nh_oif;
 
227
                fld.flowidn_scope = r->rtm_scope + 1;
 
228
 
 
229
                if (fld.flowidn_scope < RT_SCOPE_LINK)
 
230
                        fld.flowidn_scope = RT_SCOPE_LINK;
 
231
 
 
232
                if ((err = dn_fib_lookup(&fld, &res)) != 0)
233
233
                        return err;
234
234
 
235
235
                err = -EINVAL;
404
404
        return NULL;
405
405
}
406
406
 
407
 
int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowi *fl, struct dn_fib_res *res)
 
407
int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowidn *fld, struct dn_fib_res *res)
408
408
{
409
409
        int err = dn_fib_props[type].error;
410
410
 
424
424
                                for_nexthops(fi) {
425
425
                                        if (nh->nh_flags & RTNH_F_DEAD)
426
426
                                                continue;
427
 
                                        if (!fl->oif || fl->oif == nh->nh_oif)
 
427
                                        if (!fld->flowidn_oif ||
 
428
                                            fld->flowidn_oif == nh->nh_oif)
428
429
                                                break;
429
430
                                }
430
431
                                if (nhsel < fi->fib_nhs) {
445
446
        return err;
446
447
}
447
448
 
448
 
void dn_fib_select_multipath(const struct flowi *fl, struct dn_fib_res *res)
 
449
void dn_fib_select_multipath(const struct flowidn *fld, struct dn_fib_res *res)
449
450
{
450
451
        struct dn_fib_info *fi = res->fi;
451
452
        int w;