summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-10 21:04:22 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:25:26 -0700
commitaa8223c7bb0b05183e1737881ed21827aa5b9e73 (patch)
tree05c9832326edfeb878472f15cf8133ed9f014cdf /include
parentab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (diff)
downloadop-kernel-dev-aa8223c7bb0b05183e1737881ed21827aa5b9e73.zip
op-kernel-dev-aa8223c7bb0b05183e1737881ed21827aa5b9e73.tar.gz
[SK_BUFF]: Introduce tcp_hdr(), remove skb->h.th
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/skbuff.h1
-rw-r--r--include/linux/tcp.h9
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/net/tcp_ecn.h6
4 files changed, 11 insertions, 7 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e580416..8f158d6 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -237,7 +237,6 @@ struct sk_buff {
/* 4 byte hole on 64 bit*/
union {
- struct tcphdr *th;
struct iphdr *ipiph;
struct ipv6hdr *ipv6h;
unsigned char *raw;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 244ae0d..911d937 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -178,14 +178,19 @@ struct tcp_md5sig {
#include <net/inet_connection_sock.h>
#include <net/inet_timewait_sock.h>
+static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
+{
+ return (struct tcphdr *)skb->h.raw;
+}
+
static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
{
- return skb->h.th->doff * 4;
+ return tcp_hdr(skb)->doff * 4;
}
static inline unsigned int tcp_optlen(const struct sk_buff *skb)
{
- return (skb->h.th->doff - 5) * 4;
+ return (tcp_hdr(skb)->doff - 5) * 4;
}
/* This defines a selective acknowledgement block. */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 6dacc35..af92732 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -984,7 +984,7 @@ static inline void tcp_openreq_init(struct request_sock *req,
ireq->wscale_ok = rx_opt->wscale_ok;
ireq->acked = 0;
ireq->ecn_ok = 0;
- ireq->rmt_port = skb->h.th->source;
+ ireq->rmt_port = tcp_hdr(skb)->source;
}
extern void tcp_enter_memory_pressure(void);
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h
index 4629d77..b5f7c6a 100644
--- a/include/net/tcp_ecn.h
+++ b/include/net/tcp_ecn.h
@@ -54,7 +54,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp,
INET_ECN_xmit(sk);
if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) {
tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR;
- skb->h.th->cwr = 1;
+ tcp_hdr(skb)->cwr = 1;
skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
}
} else {
@@ -62,7 +62,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp,
INET_ECN_dontxmit(sk);
}
if (tp->ecn_flags & TCP_ECN_DEMAND_CWR)
- skb->h.th->ece = 1;
+ tcp_hdr(skb)->ece = 1;
}
}
@@ -70,7 +70,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp,
static inline void TCP_ECN_accept_cwr(struct tcp_sock *tp, struct sk_buff *skb)
{
- if (skb->h.th->cwr)
+ if (tcp_hdr(skb)->cwr)
tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR;
}
OpenPOWER on IntegriCloud