Skip to content

Commit fe45045

Browse files
committed
Revert "Merge branch 'master' of https://github.com/F-Stack/f-stack"
Refer #322 #323 #343 This reverts commit 2bc927f, reversing changes made to 2576201.
1 parent 22a4ca4 commit fe45045

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

freebsd/netinet/in_pcb.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,10 +1126,7 @@ if (lport == 0)
11261126
ifp_sin.sin_len = sizeof(ifp_sin);
11271127
ifa = ifa_ifwithnet((struct sockaddr *)&ifp_sin, 0, RT_ALL_FIBS);
11281128
if (ifa == NULL) {
1129-
ifp_sin.sin_addr.s_addr = faddr.s_addr;
1130-
ifa = ifa_ifwithnet((struct sockaddr *)&ifp_sin, 0, RT_ALL_FIBS);
1131-
if ( ifa == NULL )
1132-
return (EADDRNOTAVAIL);
1129+
return (EADDRNOTAVAIL);
11331130
}
11341131
ifp = ifa->ifa_ifp;
11351132
while (lport == 0) {

freebsd/netinet/tcp_usrreq.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,22 +1321,14 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
13211321
error = EADDRINUSE;
13221322
goto out;
13231323
}
1324-
1325-
// inp->inp_lport != lport means in_pcbconnect_setup selected new port to inp->inp_lport.
1326-
// inp will inhash.
1327-
if (in_pcbinshash(inp) != 0) {
1328-
inp->inp_laddr.s_addr = INADDR_ANY;
1329-
inp->inp_lport = 0;
1330-
return (EAGAIN);
1331-
}
13321324
}
1333-
else
1334-
{
1335-
// app call bind() and connect(), lport is set when bind, and the inp is inhashed in bind() function.
1336-
// in_pcbconnect_setup() update inp->inp_faddr/inp->inp_fport, so inp should be rehashed.
1337-
in_pcbrehash(inp);
1325+
1326+
if (in_pcbinshash(inp) != 0) {
1327+
inp->inp_laddr.s_addr = INADDR_ANY;
1328+
inp->inp_lport = 0;
1329+
return (EAGAIN);
13381330
}
1339-
1331+
13401332
if (anonport) {
13411333
inp->inp_flags |= INP_ANONPORT;
13421334
}

0 commit comments

Comments
 (0)