summaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-13 13:59:32 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:25:19 -0700
commit2c0fd387b00a6758550b5ca1aae4408374483fe7 (patch)
treee6bd255fb77d476424345c7864f6ee14cb0d1ddc /net/sctp/protocol.c
parent967b05f64e27d04a4c8879addd0e1c52137e2c9e (diff)
downloadblackbird-op-linux-2c0fd387b00a6758550b5ca1aae4408374483fe7.tar.gz
blackbird-op-linux-2c0fd387b00a6758550b5ca1aae4408374483fe7.zip
[SCTP]: Introduce sctp_hdr()
For consistency with all the other skb->h.raw accessors. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 08f92ba4ebd7..7c28c9b959e2 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -235,7 +235,7 @@ static void sctp_v4_from_skb(union sctp_addr *addr, struct sk_buff *skb,
port = &addr->v4.sin_port;
addr->v4.sin_family = AF_INET;
- sh = (struct sctphdr *) skb->h.raw;
+ sh = sctp_hdr(skb);
if (is_saddr) {
*port = sh->source;
from = &ip_hdr(skb)->saddr;
@@ -731,13 +731,11 @@ static void sctp_inet_event_msgname(struct sctp_ulpevent *event, char *msgname,
/* Initialize and copy out a msgname from an inbound skb. */
static void sctp_inet_skb_msgname(struct sk_buff *skb, char *msgname, int *len)
{
- struct sctphdr *sh;
- struct sockaddr_in *sin;
-
if (msgname) {
+ struct sctphdr *sh = sctp_hdr(skb);
+ struct sockaddr_in *sin = (struct sockaddr_in *)msgname;
+
sctp_inet_msgname(msgname, len);
- sin = (struct sockaddr_in *)msgname;
- sh = (struct sctphdr *)skb->h.raw;
sin->sin_port = sh->source;
sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
}
OpenPOWER on IntegriCloud