aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-12-02 20:25:54 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-03 15:14:36 -0500
commit491deb24bf5bf7124141287aaf02c3219783ceab (patch)
treef0465107e0994c89a1f8afa0091d9e7dd19f52d8 /net/core
parentd285834001df372f81045bb41092e54943e93c84 (diff)
net 02/05: fib_rules: rename ifindex/ifname/FRA_IFNAME to iifindex/iifname/FRA_IIFNAME
commit 229e77eec406ad68662f18e49fda8b5d366768c5 Author: Patrick McHardy <kaber@trash.net> Date: Thu Dec 3 12:05:23 2009 +0100 net: fib_rules: rename ifindex/ifname/FRA_IFNAME to iifindex/iifname/FRA_IIFNAME The next patch will add oif classification, rename interface related members and attributes to reflect that they're used for iif classification. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/fib_rules.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index bd309384f8b8..8e8028cdc87f 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -135,7 +135,7 @@ static int fib_rule_match(struct fib_rule *rule, struct fib_rules_ops *ops,
135{ 135{
136 int ret = 0; 136 int ret = 0;
137 137
138 if (rule->ifindex && (rule->ifindex != fl->iif)) 138 if (rule->iifindex && (rule->iifindex != fl->iif))
139 goto out; 139 goto out;
140 140
141 if ((rule->mark ^ fl->mark) & rule->mark_mask) 141 if ((rule->mark ^ fl->mark) & rule->mark_mask)
@@ -248,14 +248,14 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
248 if (tb[FRA_PRIORITY]) 248 if (tb[FRA_PRIORITY])
249 rule->pref = nla_get_u32(tb[FRA_PRIORITY]); 249 rule->pref = nla_get_u32(tb[FRA_PRIORITY]);
250 250
251 if (tb[FRA_IFNAME]) { 251 if (tb[FRA_IIFNAME]) {
252 struct net_device *dev; 252 struct net_device *dev;
253 253
254 rule->ifindex = -1; 254 rule->iifindex = -1;
255 nla_strlcpy(rule->ifname, tb[FRA_IFNAME], IFNAMSIZ); 255 nla_strlcpy(rule->iifname, tb[FRA_IIFNAME], IFNAMSIZ);
256 dev = __dev_get_by_name(net, rule->ifname); 256 dev = __dev_get_by_name(net, rule->iifname);
257 if (dev) 257 if (dev)
258 rule->ifindex = dev->ifindex; 258 rule->iifindex = dev->ifindex;
259 } 259 }
260 260
261 if (tb[FRA_FWMARK]) { 261 if (tb[FRA_FWMARK]) {
@@ -388,8 +388,8 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
388 (rule->pref != nla_get_u32(tb[FRA_PRIORITY]))) 388 (rule->pref != nla_get_u32(tb[FRA_PRIORITY])))
389 continue; 389 continue;
390 390
391 if (tb[FRA_IFNAME] && 391 if (tb[FRA_IIFNAME] &&
392 nla_strcmp(tb[FRA_IFNAME], rule->ifname)) 392 nla_strcmp(tb[FRA_IIFNAME], rule->iifname))
393 continue; 393 continue;
394 394
395 if (tb[FRA_FWMARK] && 395 if (tb[FRA_FWMARK] &&
@@ -447,7 +447,7 @@ static inline size_t fib_rule_nlmsg_size(struct fib_rules_ops *ops,
447 struct fib_rule *rule) 447 struct fib_rule *rule)
448{ 448{
449 size_t payload = NLMSG_ALIGN(sizeof(struct fib_rule_hdr)) 449 size_t payload = NLMSG_ALIGN(sizeof(struct fib_rule_hdr))
450 + nla_total_size(IFNAMSIZ) /* FRA_IFNAME */ 450 + nla_total_size(IFNAMSIZ) /* FRA_IIFNAME */
451 + nla_total_size(4) /* FRA_PRIORITY */ 451 + nla_total_size(4) /* FRA_PRIORITY */
452 + nla_total_size(4) /* FRA_TABLE */ 452 + nla_total_size(4) /* FRA_TABLE */
453 + nla_total_size(4) /* FRA_FWMARK */ 453 + nla_total_size(4) /* FRA_FWMARK */
@@ -481,11 +481,11 @@ static int fib_nl_fill_rule(struct sk_buff *skb, struct fib_rule *rule,
481 if (rule->action == FR_ACT_GOTO && rule->ctarget == NULL) 481 if (rule->action == FR_ACT_GOTO && rule->ctarget == NULL)
482 frh->flags |= FIB_RULE_UNRESOLVED; 482 frh->flags |= FIB_RULE_UNRESOLVED;
483 483
484 if (rule->ifname[0]) { 484 if (rule->iifname[0]) {
485 NLA_PUT_STRING(skb, FRA_IFNAME, rule->ifname); 485 NLA_PUT_STRING(skb, FRA_IIFNAME, rule->iifname);
486 486
487 if (rule->ifindex == -1) 487 if (rule->iifindex == -1)
488 frh->flags |= FIB_RULE_DEV_DETACHED; 488 frh->flags |= FIB_RULE_IIF_DETACHED;
489 } 489 }
490 490
491 if (rule->pref) 491 if (rule->pref)
@@ -600,9 +600,9 @@ static void attach_rules(struct list_head *rules, struct net_device *dev)
600 struct fib_rule *rule; 600 struct fib_rule *rule;
601 601
602 list_for_each_entry(rule, rules, list) { 602 list_for_each_entry(rule, rules, list) {
603 if (rule->ifindex == -1 && 603 if (rule->iifindex == -1 &&
604 strcmp(dev->name, rule->ifname) == 0) 604 strcmp(dev->name, rule->iifname) == 0)
605 rule->ifindex = dev->ifindex; 605 rule->iifindex = dev->ifindex;
606 } 606 }
607} 607}
608 608
@@ -611,8 +611,8 @@ static void detach_rules(struct list_head *rules, struct net_device *dev)
611 struct fib_rule *rule; 611 struct fib_rule *rule;
612 612
613 list_for_each_entry(rule, rules, list) 613 list_for_each_entry(rule, rules, list)
614 if (rule->ifindex == dev->ifindex) 614 if (rule->iifindex == dev->ifindex)
615 rule->ifindex = -1; 615 rule->iifindex = -1;
616} 616}
617 617
618 618