X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=net%2Fsched%2Fact_nat.c;h=d885ba311564d9a766fce6eac37edbaf0ed82b71;hb=bfb8cc31b11ccaf7cd55fd9e0f4794f82527948f;hp=0a3c8339767a9f71fe3011da3267af2b6b634391;hpb=877c357e7511395bc923ec9efc2e8b021a17ed79;p=~andy%2Flinux diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 0a3c8339767..d885ba31156 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c @@ -68,8 +68,8 @@ static int tcf_nat_init(struct nlattr *nla, struct nlattr *est, if (!pc) { pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind, &nat_idx_gen, &nat_hash_info); - if (unlikely(!pc)) - return -ENOMEM; + if (IS_ERR(pc)) + return PTR_ERR(pc); p = to_tcf_nat(pc); ret = ACT_P_CREATED; } else { @@ -124,7 +124,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, egress = p->flags & TCA_NAT_FLAG_EGRESS; action = p->tcf_action; - p->tcf_bstats.bytes += skb->len; + p->tcf_bstats.bytes += qdisc_pkt_len(skb); p->tcf_bstats.packets++; spin_unlock(&p->tcf_lock);