summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-13 14:28:48 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:25:22 -0700
commit4bedb45203eab92a87b4c863fe2d0cded633427f (patch)
treed46e43d0a08253cf85ee2db64df6aee5e4ff5a07 /net
parentd9edf9e2be0f7661558984c32bd53867a7037fd3 (diff)
downloadop-kernel-dev-4bedb45203eab92a87b4c863fe2d0cded633427f.zip
op-kernel-dev-4bedb45203eab92a87b4c863fe2d0cded633427f.tar.gz
[SK_BUFF]: Introduce udp_hdr(), remove skb->h.uh
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/netpoll.c4
-rw-r--r--net/core/pktgen.c4
-rw-r--r--net/ipv4/udp.c12
-rw-r--r--net/ipv6/udp.c10
-rw-r--r--net/rxrpc/connection.c4
-rw-r--r--net/rxrpc/transport.c4
6 files changed, 20 insertions, 18 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 8b22723..57a8244 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -296,7 +296,9 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
memcpy(skb->data, msg, len);
skb->len += len;
- skb->h.uh = udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
+ skb_push(skb, sizeof(*udph));
+ skb_reset_transport_header(skb);
+ udph = udp_hdr(skb);
udph->source = htons(np->local_port);
udph->dest = htons(np->remote_port);
udph->len = htons(udp_len);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index ee82364..160d4f0 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2392,7 +2392,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
skb->dev = odev;
skb->pkt_type = PACKET_HOST;
skb->nh.raw = (unsigned char *)iph;
- skb->h.uh = udph;
+ skb->h.raw = (unsigned char *)udph;
if (pkt_dev->nfrags <= 0)
pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
@@ -2737,7 +2737,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
skb->dev = odev;
skb->pkt_type = PACKET_HOST;
skb->nh.raw = (unsigned char *)iph;
- skb->h.uh = udph;
+ skb->h.raw = (unsigned char *)udph;
if (pkt_dev->nfrags <= 0)
pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 13875e8..926404c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -420,7 +420,7 @@ static void udp4_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb,
__be32 src, __be32 dst, int len )
{
unsigned int offset;
- struct udphdr *uh = skb->h.uh;
+ struct udphdr *uh = udp_hdr(skb);
__wsum csum = 0;
if (skb_queue_len(&sk->sk_write_queue) == 1) {
@@ -470,7 +470,7 @@ static int udp_push_pending_frames(struct sock *sk)
/*
* Create a UDP header
*/
- uh = skb->h.uh;
+ uh = udp_hdr(skb);
uh->source = fl->fl_ip_sport;
uh->dest = fl->fl_ip_dport;
uh->len = htons(up->len);
@@ -866,7 +866,7 @@ try_again:
if (sin)
{
sin->sin_family = AF_INET;
- sin->sin_port = skb->h.uh->source;
+ sin->sin_port = udp_hdr(skb)->source;
sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
}
@@ -949,7 +949,7 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
return 1;
/* Now we can get the pointers */
- uh = skb->h.uh;
+ uh = udp_hdr(skb);
udpdata = (__u8 *)uh + sizeof(struct udphdr);
udpdata32 = (__be32 *)udpdata;
@@ -1207,7 +1207,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
int proto)
{
struct sock *sk;
- struct udphdr *uh = skb->h.uh;
+ struct udphdr *uh = udp_hdr(skb);
unsigned short ulen;
struct rtable *rt = (struct rtable*)skb->dst;
__be32 saddr = ip_hdr(skb)->saddr;
@@ -1227,7 +1227,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
/* UDP validates ulen. */
if (ulen < sizeof(*uh) || pskb_trim_rcsum(skb, ulen))
goto short_packet;
- uh = skb->h.uh;
+ uh = udp_hdr(skb);
}
if (udp4_csum_init(skb, uh, proto))
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 55affe3..1e3dfb2 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -172,7 +172,7 @@ try_again:
sin6 = (struct sockaddr_in6 *) msg->msg_name;
sin6->sin6_family = AF_INET6;
- sin6->sin6_port = skb->h.uh->source;
+ sin6->sin6_port = udp_hdr(skb)->source;
sin6->sin6_flowinfo = 0;
sin6->sin6_scope_id = 0;
@@ -346,7 +346,7 @@ static int __udp6_lib_mcast_deliver(struct sk_buff *skb, struct in6_addr *saddr,
struct in6_addr *daddr, struct hlist_head udptable[])
{
struct sock *sk, *sk2;
- const struct udphdr *uh = skb->h.uh;
+ const struct udphdr *uh = udp_hdr(skb);
int dif;
read_lock(&udp_hash_lock);
@@ -420,7 +420,7 @@ int __udp6_lib_rcv(struct sk_buff **pskb, struct hlist_head udptable[],
saddr = &ipv6_hdr(skb)->saddr;
daddr = &ipv6_hdr(skb)->daddr;
- uh = skb->h.uh;
+ uh = udp_hdr(skb);
ulen = ntohs(uh->len);
if (ulen > skb->len)
@@ -441,7 +441,7 @@ int __udp6_lib_rcv(struct sk_buff **pskb, struct hlist_head udptable[],
goto short_packet;
saddr = &ipv6_hdr(skb)->saddr;
daddr = &ipv6_hdr(skb)->daddr;
- uh = skb->h.uh;
+ uh = udp_hdr(skb);
}
}
@@ -534,7 +534,7 @@ static int udp_v6_push_pending_frames(struct sock *sk)
/*
* Create a UDP header
*/
- uh = skb->h.uh;
+ uh = udp_hdr(skb);
uh->source = fl->fl_ip_sport;
uh->dest = fl->fl_ip_dport;
uh->len = htons(up->len);
diff --git a/net/rxrpc/connection.c b/net/rxrpc/connection.c
index e601fa8..665a999 100644
--- a/net/rxrpc/connection.c
+++ b/net/rxrpc/connection.c
@@ -229,10 +229,10 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
_enter("%p{{%hu}},%u,%hu",
peer,
peer->trans->port,
- ntohs(pkt->h.uh->source),
+ ntohs(udp_hdr(pkt)->source),
ntohs(msg->hdr.serviceId));
- x_port = pkt->h.uh->source;
+ x_port = udp_hdr(pkt)->source;
x_epoch = msg->hdr.epoch;
x_clflag = msg->hdr.flags & RXRPC_CLIENT_INITIATED;
x_connid = htonl(ntohl(msg->hdr.cid) & RXRPC_CIDMASK);
diff --git a/net/rxrpc/transport.c b/net/rxrpc/transport.c
index cac078b..62398fd 100644
--- a/net/rxrpc/transport.c
+++ b/net/rxrpc/transport.c
@@ -479,7 +479,7 @@ void rxrpc_trans_receive_packet(struct rxrpc_transport *trans)
}
addr = ip_hdr(pkt)->saddr;
- port = pkt->h.uh->source;
+ port = udp_hdr(pkt)->source;
_net("Rx Received UDP packet from %08x:%04hu",
ntohl(addr), ntohs(port));
@@ -625,7 +625,7 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
memset(&sin,0,sizeof(sin));
sin.sin_family = AF_INET;
- sin.sin_port = msg->pkt->h.uh->source;
+ sin.sin_port = udp_hdr(msg->pkt)->source;
sin.sin_addr.s_addr = ip_hdr(msg->pkt)->saddr;
msghdr.msg_name = &sin;
OpenPOWER on IntegriCloud