mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
slirp: Drop dead code
After all its years inside the qemu tree, there is no point in keeping the dead code paths of slirp. This patch is a first round of removing usually commented out code parts. More cleanups need to follow (and maybe finally a proper reindention). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
6dbe553fe9
commit
0d62c4cfe2
26 changed files with 22 additions and 1650 deletions
|
@ -272,39 +272,9 @@ send:
|
|||
mss = htons((u_int16_t) tcp_mss(tp, 0));
|
||||
memcpy((caddr_t)(opt + 2), (caddr_t)&mss, sizeof(mss));
|
||||
optlen = 4;
|
||||
|
||||
/* if ((tp->t_flags & TF_REQ_SCALE) &&
|
||||
* ((flags & TH_ACK) == 0 ||
|
||||
* (tp->t_flags & TF_RCVD_SCALE))) {
|
||||
* *((u_int32_t *) (opt + optlen)) = htonl(
|
||||
* TCPOPT_NOP << 24 |
|
||||
* TCPOPT_WINDOW << 16 |
|
||||
* TCPOLEN_WINDOW << 8 |
|
||||
* tp->request_r_scale);
|
||||
* optlen += 4;
|
||||
* }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Send a timestamp and echo-reply if this is a SYN and our side
|
||||
* wants to use timestamps (TF_REQ_TSTMP is set) or both our side
|
||||
* and our peer have sent timestamps in our SYN's.
|
||||
*/
|
||||
/* if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
|
||||
* (flags & TH_RST) == 0 &&
|
||||
* ((flags & (TH_SYN|TH_ACK)) == TH_SYN ||
|
||||
* (tp->t_flags & TF_RCVD_TSTMP))) {
|
||||
* u_int32_t *lp = (u_int32_t *)(opt + optlen);
|
||||
*
|
||||
* / * Form timestamp option as shown in appendix A of RFC 1323. * /
|
||||
* *lp++ = htonl(TCPOPT_TSTAMP_HDR);
|
||||
* *lp++ = htonl(tcp_now);
|
||||
* *lp = htonl(tp->ts_recent);
|
||||
* optlen += TCPOLEN_TSTAMP_APPA;
|
||||
* }
|
||||
*/
|
||||
hdrlen += optlen;
|
||||
|
||||
/*
|
||||
|
@ -334,28 +304,15 @@ send:
|
|||
|
||||
m = m_get();
|
||||
if (m == NULL) {
|
||||
/* error = ENOBUFS; */
|
||||
error = 1;
|
||||
goto out;
|
||||
}
|
||||
m->m_data += IF_MAXLINKHDR;
|
||||
m->m_len = hdrlen;
|
||||
|
||||
/*
|
||||
* This will always succeed, since we make sure our mbufs
|
||||
* are big enough to hold one MSS packet + header + ... etc.
|
||||
*/
|
||||
/* if (len <= MHLEN - hdrlen - max_linkhdr) { */
|
||||
sbcopy(&so->so_snd, off, (int) len, mtod(m, caddr_t) + hdrlen);
|
||||
m->m_len += len;
|
||||
|
||||
sbcopy(&so->so_snd, off, (int) len, mtod(m, caddr_t) + hdrlen);
|
||||
m->m_len += len;
|
||||
|
||||
/* } else {
|
||||
* m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
|
||||
* if (m->m_next == 0)
|
||||
* len = 0;
|
||||
* }
|
||||
*/
|
||||
/*
|
||||
* If we're sending everything we've got, set PUSH.
|
||||
* (This will keep happy those implementations which only
|
||||
|
@ -376,7 +333,6 @@ send:
|
|||
|
||||
m = m_get();
|
||||
if (m == NULL) {
|
||||
/* error = ENOBUFS; */
|
||||
error = 1;
|
||||
goto out;
|
||||
}
|
||||
|
@ -433,10 +389,6 @@ send:
|
|||
|
||||
if (SEQ_GT(tp->snd_up, tp->snd_una)) {
|
||||
ti->ti_urp = htons((u_int16_t)(tp->snd_up - ntohl(ti->ti_seq)));
|
||||
#ifdef notdef
|
||||
if (SEQ_GT(tp->snd_up, tp->snd_nxt)) {
|
||||
ti->ti_urp = htons((u_int16_t)(tp->snd_up - tp->snd_nxt));
|
||||
#endif
|
||||
ti->ti_flags |= TH_URG;
|
||||
} else
|
||||
/*
|
||||
|
@ -523,32 +475,10 @@ send:
|
|||
((struct ip *)ti)->ip_ttl = IPDEFTTL;
|
||||
((struct ip *)ti)->ip_tos = so->so_iptos;
|
||||
|
||||
/* #if BSD >= 43 */
|
||||
/* Don't do IP options... */
|
||||
/* error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
|
||||
* so->so_options & SO_DONTROUTE, 0);
|
||||
*/
|
||||
error = ip_output(so, m);
|
||||
|
||||
/* #else
|
||||
* error = ip_output(m, (struct mbuf *)0, &tp->t_inpcb->inp_route,
|
||||
* so->so_options & SO_DONTROUTE);
|
||||
* #endif
|
||||
*/
|
||||
}
|
||||
if (error) {
|
||||
out:
|
||||
/* if (error == ENOBUFS) {
|
||||
* tcp_quench(tp->t_inpcb, 0);
|
||||
* return (0);
|
||||
* }
|
||||
*/
|
||||
/* if ((error == EHOSTUNREACH || error == ENETDOWN)
|
||||
* && TCPS_HAVERCVDSYN(tp->t_state)) {
|
||||
* tp->t_softerror = error;
|
||||
* return (0);
|
||||
* }
|
||||
*/
|
||||
return (error);
|
||||
}
|
||||
STAT(tcpstat.tcps_sndtotal++);
|
||||
|
@ -574,9 +504,6 @@ tcp_setpersist(struct tcpcb *tp)
|
|||
{
|
||||
int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
|
||||
|
||||
/* if (tp->t_timer[TCPT_REXMT])
|
||||
* panic("tcp_output REXMT");
|
||||
*/
|
||||
/*
|
||||
* Start/restart persistence timer.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue