Commit 06fbb458 authored by Sridhar Samudrala's avatar Sridhar Samudrala

[SCTP] Fix af->dst_saddr() to fill in the port.

parent bd8b01e5
...@@ -254,7 +254,8 @@ struct sctp_af { ...@@ -254,7 +254,8 @@ struct sctp_af {
void (*copy_addrlist) (struct list_head *, void (*copy_addrlist) (struct list_head *,
struct net_device *); struct net_device *);
void (*dst_saddr) (union sctp_addr *saddr, void (*dst_saddr) (union sctp_addr *saddr,
struct dst_entry *dst); struct dst_entry *dst,
unsigned short port);
int (*cmp_addr) (const union sctp_addr *addr1, int (*cmp_addr) (const union sctp_addr *addr1,
const union sctp_addr *addr2); const union sctp_addr *addr2);
void (*addr_copy) (union sctp_addr *dst, void (*addr_copy) (union sctp_addr *dst,
......
...@@ -256,10 +256,12 @@ static void sctp_v6_to_sk(union sctp_addr *addr, struct sock *sk) ...@@ -256,10 +256,12 @@ static void sctp_v6_to_sk(union sctp_addr *addr, struct sock *sk)
} }
/* Initialize a sctp_addr from a dst_entry. */ /* Initialize a sctp_addr from a dst_entry. */
static void sctp_v6_dst_saddr(union sctp_addr *addr, struct dst_entry *dst) static void sctp_v6_dst_saddr(union sctp_addr *addr, struct dst_entry *dst,
unsigned short port)
{ {
struct rt6_info *rt = (struct rt6_info *)dst; struct rt6_info *rt = (struct rt6_info *)dst;
addr->sa.sa_family = AF_INET6; addr->sa.sa_family = AF_INET6;
addr->v6.sin6_port = port;
ipv6_addr_copy(&addr->v6.sin6_addr, &rt->rt6i_src.addr); ipv6_addr_copy(&addr->v6.sin6_addr, &rt->rt6i_src.addr);
} }
......
...@@ -292,10 +292,12 @@ static void sctp_v4_to_sk(union sctp_addr *addr, struct sock *sk) ...@@ -292,10 +292,12 @@ static void sctp_v4_to_sk(union sctp_addr *addr, struct sock *sk)
/* Initialize a sctp_addr from a dst_entry. */ /* Initialize a sctp_addr from a dst_entry. */
static void sctp_v4_dst_saddr(union sctp_addr *saddr, struct dst_entry *dst) static void sctp_v4_dst_saddr(union sctp_addr *saddr, struct dst_entry *dst,
unsigned short port)
{ {
struct rtable *rt = (struct rtable *)dst; struct rtable *rt = (struct rtable *)dst;
saddr->v4.sin_family = AF_INET; saddr->v4.sin_family = AF_INET;
saddr->v4.sin_port = port;
saddr->v4.sin_addr.s_addr = rt->rt_src; saddr->v4.sin_addr.s_addr = rt->rt_src;
} }
......
...@@ -242,7 +242,7 @@ void sctp_transport_route(struct sctp_transport *transport, ...@@ -242,7 +242,7 @@ void sctp_transport_route(struct sctp_transport *transport,
list_for_each(pos, &bp->address_list) { list_for_each(pos, &bp->address_list) {
laddr = list_entry(pos, struct sockaddr_storage_list, laddr = list_entry(pos, struct sockaddr_storage_list,
list); list);
af->dst_saddr(&dst_saddr, dst); af->dst_saddr(&dst_saddr, dst, bp->port);
if (opt->pf->cmp_addr(&dst_saddr, &laddr->a, opt)) if (opt->pf->cmp_addr(&dst_saddr, &laddr->a, opt))
goto out_unlock; goto out_unlock;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment