aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_rules.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-11-09 18:22:18 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:21:41 -0500
commitb8964ed9fa727109c9084abc807652ebfb681c18 (patch)
tree03d0c7ffb21fcba9a538c445e0fb563e392491a2 /net/decnet/dn_rules.c
parent5f300893fdd3b6e30a226c9a848eaa39b99a6431 (diff)
[NET] rules: Protocol independant mark selector
Move mark selector currently implemented per protocol into the protocol independant part. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_rules.c')
-rw-r--r--net/decnet/dn_rules.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index a09c09f5572d..1f5d23c96681 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -45,8 +45,6 @@ struct dn_fib_rule
45 __le16 dstmask; 45 __le16 dstmask;
46 __le16 srcmap; 46 __le16 srcmap;
47 u8 flags; 47 u8 flags;
48 u32 fwmark;
49 u32 fwmask;
50}; 48};
51 49
52static struct dn_fib_rule default_rule = { 50static struct dn_fib_rule default_rule = {
@@ -129,9 +127,6 @@ static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
129 ((daddr ^ r->dst) & r->dstmask)) 127 ((daddr ^ r->dst) & r->dstmask))
130 return 0; 128 return 0;
131 129
132 if ((r->fwmark ^ fl->mark) & r->fwmask)
133 return 0;
134
135 return 1; 130 return 1;
136} 131}
137 132
@@ -165,18 +160,6 @@ static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
165 if (tb[FRA_DST]) 160 if (tb[FRA_DST])
166 r->dst = nla_get_u16(tb[FRA_DST]); 161 r->dst = nla_get_u16(tb[FRA_DST]);
167 162
168 if (tb[FRA_FWMARK]) {
169 r->fwmark = nla_get_u32(tb[FRA_FWMARK]);
170 if (r->fwmark)
171 /* compatibility: if the mark value is non-zero all bits
172 * are compared unless a mask is explicitly specified.
173 */
174 r->fwmask = 0xFFFFFFFF;
175 }
176
177 if (tb[FRA_FWMASK])
178 r->fwmask = nla_get_u32(tb[FRA_FWMASK]);
179
180 r->src_len = frh->src_len; 163 r->src_len = frh->src_len;
181 r->srcmask = dnet_make_mask(r->src_len); 164 r->srcmask = dnet_make_mask(r->src_len);
182 r->dst_len = frh->dst_len; 165 r->dst_len = frh->dst_len;
@@ -197,12 +180,6 @@ static int dn_fib_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
197 if (frh->dst_len && (r->dst_len != frh->dst_len)) 180 if (frh->dst_len && (r->dst_len != frh->dst_len))
198 return 0; 181 return 0;
199 182
200 if (tb[FRA_FWMARK] && (r->fwmark != nla_get_u32(tb[FRA_FWMARK])))
201 return 0;
202
203 if (tb[FRA_FWMASK] && (r->fwmask != nla_get_u32(tb[FRA_FWMASK])))
204 return 0;
205
206 if (tb[FRA_SRC] && (r->src != nla_get_u16(tb[FRA_SRC]))) 183 if (tb[FRA_SRC] && (r->src != nla_get_u16(tb[FRA_SRC])))
207 return 0; 184 return 0;
208 185
@@ -240,10 +217,6 @@ static int dn_fib_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
240 frh->src_len = r->src_len; 217 frh->src_len = r->src_len;
241 frh->tos = 0; 218 frh->tos = 0;
242 219
243 if (r->fwmark)
244 NLA_PUT_U32(skb, FRA_FWMARK, r->fwmark);
245 if (r->fwmask || r->fwmark)
246 NLA_PUT_U32(skb, FRA_FWMASK, r->fwmask);
247 if (r->dst_len) 220 if (r->dst_len)
248 NLA_PUT_U16(skb, FRA_DST, r->dst); 221 NLA_PUT_U16(skb, FRA_DST, r->dst);
249 if (r->src_len) 222 if (r->src_len)