aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-13 12:59:32 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:19 -0400
commit2c0fd387b00a6758550b5ca1aae4408374483fe7 (patch)
treee6bd255fb77d476424345c7864f6ee14cb0d1ddc /net/sctp/protocol.c
parent967b05f64e27d04a4c8879addd0e1c52137e2c9e (diff)
[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,
235 port = &addr->v4.sin_port; 235 port = &addr->v4.sin_port;
236 addr->v4.sin_family = AF_INET; 236 addr->v4.sin_family = AF_INET;
237 237
238 sh = (struct sctphdr *) skb->h.raw; 238 sh = sctp_hdr(skb);
239 if (is_saddr) { 239 if (is_saddr) {
240 *port = sh->source; 240 *port = sh->source;
241 from = &ip_hdr(skb)->saddr; 241 from = &ip_hdr(skb)->saddr;
@@ -731,13 +731,11 @@ static void sctp_inet_event_msgname(struct sctp_ulpevent *event, char *msgname,
731/* Initialize and copy out a msgname from an inbound skb. */ 731/* Initialize and copy out a msgname from an inbound skb. */
732static void sctp_inet_skb_msgname(struct sk_buff *skb, char *msgname, int *len) 732static void sctp_inet_skb_msgname(struct sk_buff *skb, char *msgname, int *len)
733{ 733{
734 struct sctphdr *sh;
735 struct sockaddr_in *sin;
736
737 if (msgname) { 734 if (msgname) {
735 struct sctphdr *sh = sctp_hdr(skb);
736 struct sockaddr_in *sin = (struct sockaddr_in *)msgname;
737
738 sctp_inet_msgname(msgname, len); 738 sctp_inet_msgname(msgname, len);
739 sin = (struct sockaddr_in *)msgname;
740 sh = (struct sctphdr *)skb->h.raw;
741 sin->sin_port = sh->source; 739 sin->sin_port = sh->source;
742 sin->sin_addr.s_addr = ip_hdr(skb)->saddr; 740 sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
743 } 741 }