Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95394
b: refs/heads/master
c: 443a70d
h: refs/heads/master
v: v3
  • Loading branch information
Philip Craig authored and David S. Miller committed Apr 29, 2008
1 parent a0cb627 commit de228e2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0010e46577a27c1d915034637f6c2fa57a9a091c
refs/heads/master: 443a70d50bdc212e1292778e264ce3d0a85b896f
10 changes: 0 additions & 10 deletions trunk/include/net/netfilter/nf_conntrack_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ struct nf_conntrack_tuple_mask
} src;
};

/* This is optimized opposed to a memset of the whole structure. Everything we
* really care about is the source/destination unions */
#define NF_CT_TUPLE_U_BLANK(tuple) \
do { \
(tuple)->src.u.all = 0; \
(tuple)->dst.u.all = 0; \
memset(&(tuple)->src.u3, 0, sizeof((tuple)->src.u3)); \
memset(&(tuple)->dst.u3, 0, sizeof((tuple)->dst.u3)); \
} while (0)

#ifdef __KERNEL__

static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
const struct nf_conntrack_tuple_hash *h;
struct nf_conntrack_tuple tuple;

NF_CT_TUPLE_U_BLANK(&tuple);
memset(&tuple, 0, sizeof(tuple));
tuple.src.u3.ip = inet->rcv_saddr;
tuple.src.u.tcp.port = inet->sport;
tuple.dst.u3.ip = inet->daddr;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ nf_ct_get_tuple(const struct sk_buff *skb,
const struct nf_conntrack_l3proto *l3proto,
const struct nf_conntrack_l4proto *l4proto)
{
NF_CT_TUPLE_U_BLANK(tuple);
memset(tuple, 0, sizeof(*tuple));

tuple->src.l3num = l3num;
if (l3proto->pkt_to_tuple(skb, nhoff, tuple) == 0)
Expand Down Expand Up @@ -151,7 +151,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
const struct nf_conntrack_l3proto *l3proto,
const struct nf_conntrack_l4proto *l4proto)
{
NF_CT_TUPLE_U_BLANK(inverse);
memset(inverse, 0, sizeof(*inverse));

inverse->src.l3num = orig->src.l3num;
if (l3proto->invert_tuple(inverse, orig) == 0)
Expand Down

0 comments on commit de228e2

Please sign in to comment.