Skip to contentSkip to conversation

sctp: fix to only enable IPv6 address support on PF_INET6

PATCH New Wei Yongjun 1 participant 1 message Apr 7, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sctp: fix to only enable IPv6 address support on PF_INET6

If socket is create by PF_INET type, it can not used IPv6 address to send/recv DATA. So only enable IPv6 address support on PF_INET6 socket.

---
 net/sctp/associola.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/sctp/associola.c +2 -1
index f4b2304..e7b69a7 100644
@@ -293,7 +293,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
 	 * told otherwise.
 	 */
 	asoc->peer.ipv4_address = 1;
-	asoc->peer.ipv6_address = 1;
+	if (asoc->base.sk->sk_family = PF_INET6)
+		asoc->peer.ipv6_address = 1;
 	INIT_LIST_HEAD(&asoc->asocs);
 
 	asoc->autoclose = sp->autoclose;
Signature · 1 line
1.5.3.8