Re: NetFilter: portability fixes

From: Rusty Russell (rusty@linuxcare.com.au)
Date: Wed May 31 2000 - 10:43:44 EST


In message <200005302327.AAA01202@raistlin.arm.linux.org.uk> you write:
> The following patch fixes this bogosity by:

Does it actually fix anything? Or just save 2 bytes on ARM?

If you want to be pedantic, I would prefer changing the memcmps to
something like:

extern inline int ip_ct_tuple_src_equal(const struct ip_conntrack_tuple *t1,
                                        const struct ip_conntrack_tuple *t2)
{
        return t1->src.ip == t2->src.ip
                && t1->src.u.all == t2->src.u.all;
}

extern inline int ip_ct_tuple_dst_equal(const struct ip_conntrack_tuple *t1,
                                        const struct ip_conntrack_tuple *t2)
{
        return t1->dst.ip == t2->dst.ip
                && t1->dst.u.all == t2->dst.u.all
                && t1->dst.protonum == t2->dst.protonum;
}

extern inline int ip_ct_tuple_equal(const struct ip_conntrack_tuple *t1,
                                    const struct ip_conntrack_tuple *t2)
{
        return ip_ct_tuple_src_equal(t1, t2)
                && ip_ct_tuple_dst_equal(t1, t2);
}

Prefer that approach?
Rusty.

--
Hacking time.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:14 EST