diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index e17a823ca90f..c361deb6cea9 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -235,13 +235,13 @@ 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 = &skb->nh.iph->saddr; | 241 | from = &ip_hdr(skb)->saddr; |
242 | } else { | 242 | } else { |
243 | *port = sh->dest; | 243 | *port = sh->dest; |
244 | from = &skb->nh.iph->daddr; | 244 | from = &ip_hdr(skb)->daddr; |
245 | } | 245 | } |
246 | memcpy(&addr->v4.sin_addr.s_addr, from, sizeof(struct in_addr)); | 246 | memcpy(&addr->v4.sin_addr.s_addr, from, sizeof(struct in_addr)); |
247 | } | 247 | } |
@@ -530,7 +530,7 @@ static int sctp_v4_skb_iif(const struct sk_buff *skb) | |||
530 | /* Was this packet marked by Explicit Congestion Notification? */ | 530 | /* Was this packet marked by Explicit Congestion Notification? */ |
531 | static int sctp_v4_is_ce(const struct sk_buff *skb) | 531 | static int sctp_v4_is_ce(const struct sk_buff *skb) |
532 | { | 532 | { |
533 | return INET_ECN_is_ce(skb->nh.iph->tos); | 533 | return INET_ECN_is_ce(ip_hdr(skb)->tos); |
534 | } | 534 | } |
535 | 535 | ||
536 | /* Create and initialize a new sk for the socket returned by accept(). */ | 536 | /* Create and initialize a new sk for the socket returned by accept(). */ |
@@ -731,15 +731,13 @@ 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. */ |
732 | static void sctp_inet_skb_msgname(struct sk_buff *skb, char *msgname, int *len) | 732 | static 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 = skb->nh.iph->saddr; | 740 | sin->sin_addr.s_addr = ip_hdr(skb)->saddr; |
743 | } | 741 | } |
744 | } | 742 | } |
745 | 743 | ||
@@ -1044,7 +1042,7 @@ SCTP_STATIC __init int sctp_init(void) | |||
1044 | sctp_cookie_preserve_enable = 1; | 1042 | sctp_cookie_preserve_enable = 1; |
1045 | 1043 | ||
1046 | /* Max.Burst - 4 */ | 1044 | /* Max.Burst - 4 */ |
1047 | sctp_max_burst = SCTP_MAX_BURST; | 1045 | sctp_max_burst = SCTP_DEFAULT_MAX_BURST; |
1048 | 1046 | ||
1049 | /* Association.Max.Retrans - 10 attempts | 1047 | /* Association.Max.Retrans - 10 attempts |
1050 | * Path.Max.Retrans - 5 attempts (per destination address) | 1048 | * Path.Max.Retrans - 5 attempts (per destination address) |