diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index d5878ae55840..6abc8b274270 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -101,7 +101,6 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist, | |||
101 | addr = kzalloc(sizeof(*addr), GFP_ATOMIC); | 101 | addr = kzalloc(sizeof(*addr), GFP_ATOMIC); |
102 | if (addr) { | 102 | if (addr) { |
103 | addr->a.v4.sin_family = AF_INET; | 103 | addr->a.v4.sin_family = AF_INET; |
104 | addr->a.v4.sin_port = 0; | ||
105 | addr->a.v4.sin_addr.s_addr = ifa->ifa_local; | 104 | addr->a.v4.sin_addr.s_addr = ifa->ifa_local; |
106 | addr->valid = 1; | 105 | addr->valid = 1; |
107 | INIT_LIST_HEAD(&addr->list); | 106 | INIT_LIST_HEAD(&addr->list); |
@@ -441,7 +440,8 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr, | |||
441 | } | 440 | } |
442 | if (saddr) { | 441 | if (saddr) { |
443 | fl4->saddr = saddr->v4.sin_addr.s_addr; | 442 | fl4->saddr = saddr->v4.sin_addr.s_addr; |
444 | fl4->fl4_sport = saddr->v4.sin_port; | 443 | if (!fl4->fl4_sport) |
444 | fl4->fl4_sport = saddr->v4.sin_port; | ||
445 | } | 445 | } |
446 | 446 | ||
447 | pr_debug("%s: dst:%pI4, src:%pI4 - ", __func__, &fl4->daddr, | 447 | pr_debug("%s: dst:%pI4, src:%pI4 - ", __func__, &fl4->daddr, |
@@ -776,10 +776,9 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | |||
776 | 776 | ||
777 | switch (ev) { | 777 | switch (ev) { |
778 | case NETDEV_UP: | 778 | case NETDEV_UP: |
779 | addr = kmalloc(sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC); | 779 | addr = kzalloc(sizeof(*addr), GFP_ATOMIC); |
780 | if (addr) { | 780 | if (addr) { |
781 | addr->a.v4.sin_family = AF_INET; | 781 | addr->a.v4.sin_family = AF_INET; |
782 | addr->a.v4.sin_port = 0; | ||
783 | addr->a.v4.sin_addr.s_addr = ifa->ifa_local; | 782 | addr->a.v4.sin_addr.s_addr = ifa->ifa_local; |
784 | addr->valid = 1; | 783 | addr->valid = 1; |
785 | spin_lock_bh(&net->sctp.local_addr_lock); | 784 | spin_lock_bh(&net->sctp.local_addr_lock); |