Skip to contentSkip to conversation

sctp: list pmtudisc initizlisation for ipv4 sctp socket

PATCH In review Pavel Emelyanov 2 participants 2 messages Jul 24, 2008

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

PATCH 1/1 sctp: list pmtudisc initizlisation for ipv4 sctp socket

I'm not sure whether this was done deliberately, but the sctp_v4_create_accept_sk doesn't set the newinet->pmtudisc like it is done in both cases (ipv4 and v6) for tcp sockets and for sctp over ipv6 socket.

This loss is painless, I suppose, since the whole socket is zeroed by default and thus this field is automatically set to IP_PMTUDISC_DONT.

Restore this setting logic for sctp over ipv4 socket.

---

net/sctp/protocol.c +5 -0
index a6e0818..b05c739 100644
@@ -626,6 +626,11 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk,
 	newinet->mc_index = 0;
 	newinet->mc_list = NULL;
 
+	if (ipv4_config.no_pmtu_disc)
+		newinet->pmtudisc = IP_PMTUDISC_DONT;
+	else
+		newinet->pmtudisc = IP_PMTUDISC_WANT;
+
 	sk_refcnt_debug_inc(newsk);
 
 	if (newsk->sk_prot->init(newsk)) {
#1 lore raw
Quoted 21 lines · Pavel Emelyanov

I'm not sure whether this was done deliberately, but the sctp_v4_create_accept_sk doesn't set the newinet->pmtudisc like it is done in both cases (ipv4 and v6) for tcp sockets and for sctp over ipv6 socket.

This loss is painless, I suppose, since the whole socket is zeroed by default and thus this field is automatically set to IP_PMTUDISC_DONT.

Restore this setting logic for sctp over ipv4 socket.

---

net/sctp/protocol.c +0 -0
index a6e0818..b05c739 100644
@@ -626,6 +626,11 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk,
 	newinet->mc_index = 0;

net/sctp/protocol.c static struct sock *sctp_v4_create_accept_sk(struct sock *sk, · line 636

Quoted 10 lines
net/sctp/protocol.c +5 -0
 	newinet->mc_list = NULL;
 
+	if (ipv4_config.no_pmtu_disc)
+		newinet->pmtudisc = IP_PMTUDISC_DONT;
+	else
+		newinet->pmtudisc = IP_PMTUDISC_WANT;
+
 	sk_refcnt_debug_inc(newsk);
 
 	if (newsk->sk_prot->init(newsk)) {

Hi Pavel

We already inherit the settings from the parent socket here:

        newinet->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr;
        newinet->pmtudisc = inet->pmtudisc;
        newinet->id = asoc->next_tsn ^ jiffies;

So NACK.

-vlad