aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/sctp/structs.h4
-rw-r--r--net/sctp/bind_addr.c2
-rw-r--r--net/sctp/ipv6.c9
-rw-r--r--net/sctp/protocol.c7
-rw-r--r--net/sctp/sm_make_chunk.c1
-rw-r--r--net/sctp/transport.c3
6 files changed, 19 insertions, 7 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 953a73f9689c..2c35f2fd5601 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -713,6 +713,7 @@ struct sctp_chunk {
713 unsigned long sent_at; 713 unsigned long sent_at;
714 714
715 /* What is the origin IP address for this chunk? */ 715 /* What is the origin IP address for this chunk? */
716 union sctp_addr source;
716 union sctp_addr source_h; 717 union sctp_addr source_h;
717 /* Destination address for this chunk. */ 718 /* Destination address for this chunk. */
718 union sctp_addr dest; 719 union sctp_addr dest;
@@ -756,6 +757,7 @@ const union sctp_addr *sctp_source(const struct sctp_chunk *chunk);
756/* This is a structure for holding either an IPv6 or an IPv4 address. */ 757/* This is a structure for holding either an IPv6 or an IPv4 address. */
757struct sctp_sockaddr_entry { 758struct sctp_sockaddr_entry {
758 struct list_head list; 759 struct list_head list;
760 union sctp_addr a;
759 union sctp_addr a_h; 761 union sctp_addr a_h;
760 __u8 use_as_src; 762 __u8 use_as_src;
761}; 763};
@@ -842,6 +844,7 @@ struct sctp_transport {
842 int dead; 844 int dead;
843 845
844 /* This is the peer's IP address and port. */ 846 /* This is the peer's IP address and port. */
847 union sctp_addr ipaddr;
845 union sctp_addr ipaddr_h; 848 union sctp_addr ipaddr_h;
846 849
847 /* These are the functions we call to handle LLP stuff. */ 850 /* These are the functions we call to handle LLP stuff. */
@@ -900,6 +903,7 @@ struct sctp_transport {
900 /* Destination */ 903 /* Destination */
901 struct dst_entry *dst; 904 struct dst_entry *dst;
902 /* Source address. */ 905 /* Source address. */
906 union sctp_addr saddr;
903 union sctp_addr saddr_h; 907 union sctp_addr saddr_h;
904 908
905 /* When was the last time(in jiffies) that a data packet was sent on 909 /* When was the last time(in jiffies) that a data packet was sent on
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index b8115cb31ae3..2b36e4238170 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -163,6 +163,8 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
163 if (!addr->a_h.v4.sin_port) 163 if (!addr->a_h.v4.sin_port)
164 addr->a_h.v4.sin_port = bp->port; 164 addr->a_h.v4.sin_port = bp->port;
165 165
166 flip_to_n(&addr->a, &addr->a_h);
167
166 addr->use_as_src = use_as_src; 168 addr->use_as_src = use_as_src;
167 169
168 INIT_LIST_HEAD(&addr->list); 170 INIT_LIST_HEAD(&addr->list);
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index e533970fa335..8ebd177296ba 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -332,10 +332,11 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
332 /* Add the address to the local list. */ 332 /* Add the address to the local list. */
333 addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC); 333 addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
334 if (addr) { 334 if (addr) {
335 addr->a_h.v6.sin6_family = AF_INET6; 335 addr->a.v6.sin6_family = AF_INET6;
336 addr->a_h.v6.sin6_port = 0; 336 addr->a.v6.sin6_port = 0;
337 addr->a_h.v6.sin6_addr = ifp->addr; 337 addr->a.v6.sin6_addr = ifp->addr;
338 addr->a_h.v6.sin6_scope_id = dev->ifindex; 338 addr->a.v6.sin6_scope_id = dev->ifindex;
339 addr->a_h = addr->a;
339 INIT_LIST_HEAD(&addr->list); 340 INIT_LIST_HEAD(&addr->list);
340 list_add_tail(&addr->list, addrlist); 341 list_add_tail(&addr->list, addrlist);
341 } 342 }
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 20883ffd51d9..363274045032 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -150,9 +150,10 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist,
150 /* Add the address to the local list. */ 150 /* Add the address to the local list. */
151 addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC); 151 addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
152 if (addr) { 152 if (addr) {
153 addr->a_h.v4.sin_family = AF_INET; 153 addr->a.v4.sin_family = AF_INET;
154 addr->a_h.v4.sin_port = 0; 154 addr->a.v4.sin_port = 0;
155 addr->a_h.v4.sin_addr.s_addr = ifa->ifa_local; 155 addr->a.v4.sin_addr.s_addr = ifa->ifa_local;
156 addr->a_h = addr->a;
156 list_add_tail(&addr->list, addrlist); 157 list_add_tail(&addr->list, addrlist);
157 } 158 }
158 } 159 }
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 13109cfc3ae5..b8e0f72b319f 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1032,6 +1032,7 @@ void sctp_init_addrs(struct sctp_chunk *chunk, union sctp_addr *src,
1032 union sctp_addr *dest) 1032 union sctp_addr *dest)
1033{ 1033{
1034 memcpy(&chunk->source_h, src, sizeof(union sctp_addr)); 1034 memcpy(&chunk->source_h, src, sizeof(union sctp_addr));
1035 flip_to_n(&chunk->source, &chunk->source_h);
1035 memcpy(&chunk->dest, dest, sizeof(union sctp_addr)); 1036 memcpy(&chunk->dest, dest, sizeof(union sctp_addr));
1036} 1037}
1037 1038
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 1f56c9d95739..bacd09448b8e 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -62,10 +62,12 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
62{ 62{
63 /* Copy in the address. */ 63 /* Copy in the address. */
64 peer->ipaddr_h = *addr; 64 peer->ipaddr_h = *addr;
65 flip_to_n(&peer->ipaddr, &peer->ipaddr_h);
65 peer->af_specific = sctp_get_af_specific(addr->sa.sa_family); 66 peer->af_specific = sctp_get_af_specific(addr->sa.sa_family);
66 peer->asoc = NULL; 67 peer->asoc = NULL;
67 68
68 peer->dst = NULL; 69 peer->dst = NULL;
70 memset(&peer->saddr, 0, sizeof(union sctp_addr));
69 memset(&peer->saddr_h, 0, sizeof(union sctp_addr)); 71 memset(&peer->saddr_h, 0, sizeof(union sctp_addr));
70 72
71 /* From 6.3.1 RTO Calculation: 73 /* From 6.3.1 RTO Calculation:
@@ -258,6 +260,7 @@ void sctp_transport_route(struct sctp_transport *transport,
258 memcpy(&transport->saddr_h, saddr, sizeof(union sctp_addr)); 260 memcpy(&transport->saddr_h, saddr, sizeof(union sctp_addr));
259 else 261 else
260 af->get_saddr(asoc, dst, daddr, &transport->saddr_h); 262 af->get_saddr(asoc, dst, daddr, &transport->saddr_h);
263 flip_to_n(&transport->saddr, &transport->saddr_h);
261 264
262 transport->dst = dst; 265 transport->dst = dst;
263 if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) { 266 if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) {