} dst;
};
+/* This is optimized opposed to a memset of the whole structure. Everything we
+ * really care about is the source/destination unions */
+#define IP_CT_TUPLE_U_BLANK(tuple) \
+ do { \
+ (tuple)->src.u.all = 0; \
+ (tuple)->dst.u.all = 0; \
+ } while (0)
+
enum ip_conntrack_dir
{
IP_CT_DIR_ORIGINAL,
{
struct inet_opt *inet = inet_sk(sk);
struct ip_conntrack_tuple_hash *h;
- struct ip_conntrack_tuple tuple = { { inet->rcv_saddr,
- { .tcp = { inet->sport } } },
- { inet->daddr,
- { .tcp = { inet->dport } },
- IPPROTO_TCP } };
+ struct ip_conntrack_tuple tuple;
+
+ IP_CT_TUPLE_U_BLANK(&tuple);
+ tuple.src.ip = inet->rcv_saddr;
+ tuple.src.u.tcp.port = inet->sport;
+ tuple.dst.ip = inet->daddr;
+ tuple.dst.u.tcp.port = inet->dport;
+ tuple.dst.protonum = IPPROTO_TCP;
/* We only do TCP at the moment: is there a better way? */
if (strcmp(sk->sk_prot->name, "TCP")) {