Skip to contentSkip to conversation

Fix to multiple tables routing

DECNET Applied Steven Whitehouse 3 participants 4 messages Aug 11, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Here is a fix to Patrick McHardy's increase number of routing tables patch for DECnet. I did just test this and it appears to be working fine with this patch.

Cc Patrick McHardy <[email protected]>
Cc Patrick Caulfield <[email protected]>
net/decnet/dn_rules.c +1 -0
index 878312f..c8d9411 100644
@@ -116,6 +116,7 @@ static struct nla_policy dn_fib_rule_pol
 	[FRA_SRC]	= { .type = NLA_U16 },
 	[FRA_DST]	= { .type = NLA_U16 },
 	[FRA_FWMARK]	= { .type = NLA_U32 },
+	[FRA_TABLE]     = { .type = NLA_U32 },
 };
 
 static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
#1 lore raw
Quoted 13 lines · Steven Whitehouse

Here is a fix to Patrick McHardy's increase number of routing tables patch for DECnet. I did just test this and it appears to be working fine with this patch.

Cc Patrick McHardy <[email protected]>
Cc Patrick Caulfield <[email protected]>
net/decnet/dn_rules.c +0 -0
index 878312f..c8d9411 100644

net/decnet/dn_rules.c static struct nla_policy dn_fib_rule_pol · line 120

Quoted 5 lines
net/decnet/dn_rules.c +1 -0
@@ -116,6 +116,7 @@ static struct nla_policy dn_fib_rule_pol
 	[FRA_SRC]	= { .type = NLA_U16 },
 	[FRA_DST]	= { .type = NLA_U16 },
 	[FRA_FWMARK]	= { .type = NLA_U32 },
+	[FRA_TABLE]     = { .type = NLA_U32 },
 };

Looks good. BTW, I noticed something in the DecNET fib_rule conversion that looks like a bug:

The policy includes this for FRA_SRC/FRA_DST:

        [FRA_SRC]       = { .type = NLA_U16 },
        [FRA_DST]       = { .type = NLA_U16 },

But in dn_fib_rule_compare it is used like this:

        if (tb[FRA_SRC] && (r->src != nla_get_u32(tb[FRA_SRC])))
                return 0;

        if (tb[FRA_DST] && (r->dst != nla_get_u32(tb[FRA_DST])))
                return 0;

I think this might create problems depending on the endianness.

#2 lore raw

Hi,

Quoted 30 lines · Patrick McHardy
Quoted 13 lines · Steven Whitehouse

Here is a fix to Patrick McHardy's increase number of routing tables patch for DECnet. I did just test this and it appears to be working fine with this patch.

Cc Patrick McHardy <[email protected]>
Cc Patrick Caulfield <[email protected]>
net/decnet/dn_rules.c +0 -0
index 878312f..c8d9411 100644

net/decnet/dn_rules.c static struct nla_policy dn_fib_rule_pol · line 120

Quoted 5 lines
net/decnet/dn_rules.c +1 -0
@@ -116,6 +116,7 @@ static struct nla_policy dn_fib_rule_pol
 	[FRA_SRC]	= { .type = NLA_U16 },
 	[FRA_DST]	= { .type = NLA_U16 },
 	[FRA_FWMARK]	= { .type = NLA_U32 },
+	[FRA_TABLE]     = { .type = NLA_U32 },
 };

Looks good. BTW, I noticed something in the DecNET fib_rule conversion that looks like a bug:

The policy includes this for FRA_SRC/FRA_DST:

        [FRA_SRC]       = { .type = NLA_U16 },
        [FRA_DST]       = { .type = NLA_U16 },

But in dn_fib_rule_compare it is used like this:

Quoted 7 lines
        if (tb[FRA_SRC] && (r->src != nla_get_u32(tb[FRA_SRC])))
                return 0;

        if (tb[FRA_DST] && (r->dst != nla_get_u32(tb[FRA_DST])))
                return 0;

I think this might create problems depending on the endianness.

Yes, good spotting :-) I'll send a patch shortly,

Steve.

maintainer Applied
#3 lore raw
In reply to Steven Whitehouse

From: Steven Whitehouse <[email protected]>
Date: Fri, 11 Aug 2006 15:27:42 +0100

Quoted 7 lines

Here is a fix to Patrick McHardy's increase number of routing tables patch for DECnet. I did just test this and it appears to be working fine with this patch.

Cc Patrick McHardy <[email protected]>
Cc Patrick Caulfield <[email protected]>

Applied, thanks Steven.