1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

inpcb: update inpcb multipath routing information only on success

This is very similar to IPv4 change 24e5c2ee2a.  Don't modify inpcb
until we are sure connect(2) will be successful.

Fixes:	0c325f53f1
This commit is contained in:
Gleb Smirnoff
2026-05-26 09:02:06 -07:00
parent ca91300c07
commit d62e8c5c6f
+10 -9
View File
@@ -465,15 +465,6 @@ in6_pcbconnect(struct inpcb *inp, struct sockaddr_in6 *sin6, struct ucred *cred,
bzero(&laddr6, sizeof(laddr6));
laddr6.sin6_family = AF_INET6;
if (V_fib_hash_outbound) {
uint32_t hash_type, hash_val;
hash_val = fib6_calc_software_hash(&inp->in6p_laddr,
&sin6->sin6_addr, 0, sin6->sin6_port,
inp->inp_socket->so_proto->pr_protocol, &hash_type);
inp->inp_flowid = hash_val;
inp->inp_flowtype = hash_type;
}
/*
* Call inner routine, to assign local interface address.
* in6_pcbladdr() may automatically fill in sin6_scope_id.
@@ -520,6 +511,16 @@ in6_pcbconnect(struct inpcb *inp, struct sockaddr_in6 *sin6, struct ucred *cred,
in_pcbrehash(inp);
INP_HASH_WUNLOCK(pcbinfo);
if (V_fib_hash_outbound) {
uint32_t hash_type, hash_val;
hash_val = fib6_calc_software_hash(&inp->in6p_laddr,
&sin6->sin6_addr, 0, sin6->sin6_port,
inp->inp_socket->so_proto->pr_protocol, &hash_type);
inp->inp_flowid = hash_val;
inp->inp_flowtype = hash_type;
}
return (0);
}