Fix warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5170 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -45,6 +45,11 @@ struct arc4_stream {
|
|||||||
int rs_initialized;
|
int rs_initialized;
|
||||||
static struct arc4_stream rs;
|
static struct arc4_stream rs;
|
||||||
|
|
||||||
|
void arc4random_stir(void);
|
||||||
|
void arc4random_addrandom(u_char *dat, int datlen);
|
||||||
|
uint32 arc4random(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static inline void arc4_init(struct arc4_stream *as)
|
static inline void arc4_init(struct arc4_stream *as)
|
||||||
{
|
{
|
||||||
@@ -138,7 +143,7 @@ void arc4random_addrandom(u_char *dat, int datlen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32 arc4random()
|
uint32 arc4random(void)
|
||||||
{
|
{
|
||||||
if (!rs_initialized)
|
if (!rs_initialized)
|
||||||
arc4random_stir();
|
arc4random_stir();
|
||||||
|
|||||||
@@ -139,6 +139,9 @@ extern uint32 sb_max;
|
|||||||
}\
|
}\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tcp_reass(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insert segment ti into reassembly queue of tcp with
|
* Insert segment ti into reassembly queue of tcp with
|
||||||
* control block tp. Return TH_FIN if reassembly now includes
|
* control block tp. Return TH_FIN if reassembly now includes
|
||||||
@@ -340,7 +343,7 @@ void tcp_input(struct mbuf *m, int iphlen)
|
|||||||
*/
|
*/
|
||||||
ti = mtod(m, struct tcpiphdr*);
|
ti = mtod(m, struct tcpiphdr*);
|
||||||
|
|
||||||
if (iphlen > sizeof(struct ip))
|
if (iphlen > (int) sizeof(struct ip))
|
||||||
ipm->ip_stripoptions(m, NULL);
|
ipm->ip_stripoptions(m, NULL);
|
||||||
|
|
||||||
if (m->m_len < sizeof(struct tcpiphdr)) {
|
if (m->m_len < sizeof(struct tcpiphdr)) {
|
||||||
@@ -368,7 +371,7 @@ void tcp_input(struct mbuf *m, int iphlen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
off = ti->ti_off << 2;
|
off = ti->ti_off << 2;
|
||||||
if (off < sizeof(struct tcphdr) || off > tlen) {
|
if (off < (int) sizeof(struct tcphdr) || off > tlen) {
|
||||||
tcpstat.tcps_rcvbadoff++;
|
tcpstat.tcps_rcvbadoff++;
|
||||||
printf("tcp_input: bad len\n");
|
printf("tcp_input: bad len\n");
|
||||||
goto drop;
|
goto drop;
|
||||||
@@ -377,7 +380,7 @@ void tcp_input(struct mbuf *m, int iphlen)
|
|||||||
tlen -=off;
|
tlen -=off;
|
||||||
ti->ti_len = tlen;
|
ti->ti_len = tlen;
|
||||||
|
|
||||||
if (off > sizeof(struct tcphdr)) {
|
if (off > (int) sizeof(struct tcphdr)) {
|
||||||
if (m->m_len < sizeof(struct ip) + off) {
|
if (m->m_len < sizeof(struct ip) + off) {
|
||||||
if ((m = m_pullup(m, sizeof(struct ip) + off)) == NULL) {
|
if ((m = m_pullup(m, sizeof(struct ip) + off)) == NULL) {
|
||||||
tcpstat.tcps_rcvshort++;
|
tcpstat.tcps_rcvshort++;
|
||||||
@@ -1164,7 +1167,7 @@ close:
|
|||||||
|
|
||||||
if (cw > tp->snd_ssthresh)
|
if (cw > tp->snd_ssthresh)
|
||||||
incr = incr * incr / cw + incr / 8;
|
incr = incr * incr / cw + incr / 8;
|
||||||
tp->snd_cwnd = min(cw + incr, TCP_MAXWIN << tp->snd_scale);
|
tp->snd_cwnd = min((int) (cw + incr), TCP_MAXWIN << tp->snd_scale);
|
||||||
}
|
}
|
||||||
if (acked > so->so_snd.sb_cc) {
|
if (acked > so->so_snd.sb_cc) {
|
||||||
tp->snd_wnd -= so->so_snd.sb_cc;
|
tp->snd_wnd -= so->so_snd.sb_cc;
|
||||||
@@ -1275,7 +1278,7 @@ step6:
|
|||||||
* soreceive. It's hard to imagine someone
|
* soreceive. It's hard to imagine someone
|
||||||
* actually wanting to send this much urgent data.
|
* actually wanting to send this much urgent data.
|
||||||
*/
|
*/
|
||||||
if (ti->ti_urp + so->so_rcv.sb_cc > sb_max) {
|
if (ti->ti_urp + so->so_rcv.sb_cc > (int) sb_max) {
|
||||||
ti->ti_urp = 0; /* XXX */
|
ti->ti_urp = 0; /* XXX */
|
||||||
tiflags &= ~TH_URG; /* XXX */
|
tiflags &= ~TH_URG; /* XXX */
|
||||||
goto dodata; /* XXX */
|
goto dodata; /* XXX */
|
||||||
@@ -1526,7 +1529,7 @@ void tcp_pulloutofband(struct socket *so, struct tcpiphdr *ti, struct mbuf *m)
|
|||||||
int cnt = ti->ti_urp - 1;
|
int cnt = ti->ti_urp - 1;
|
||||||
|
|
||||||
while (cnt >= 0) {
|
while (cnt >= 0) {
|
||||||
if (m->m_len > cnt) {
|
if ((int) m->m_len > cnt) {
|
||||||
char *cp = mtod(m, caddr_t) + cnt;
|
char *cp = mtod(m, caddr_t) + cnt;
|
||||||
struct tcpcb *tp = sototcpcb(so);
|
struct tcpcb *tp = sototcpcb(so);
|
||||||
|
|
||||||
@@ -1683,7 +1686,7 @@ void tcp_mss_update(struct tcpcb *tp)
|
|||||||
if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
|
if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
|
||||||
#endif
|
#endif
|
||||||
bufsize = so->so_snd.sb_hiwat;
|
bufsize = so->so_snd.sb_hiwat;
|
||||||
if (bufsize < mss) {
|
if ((int) bufsize < mss) {
|
||||||
mss = bufsize;
|
mss = bufsize;
|
||||||
/* Update t_maxseg and t_maxopd */
|
/* Update t_maxseg and t_maxopd */
|
||||||
tcp_mss(tp, mss);
|
tcp_mss(tp, mss);
|
||||||
@@ -1698,7 +1701,7 @@ void tcp_mss_update(struct tcpcb *tp)
|
|||||||
if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
|
if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
|
||||||
#endif
|
#endif
|
||||||
bufsize = so->so_rcv.sb_hiwat;
|
bufsize = so->so_rcv.sb_hiwat;
|
||||||
if (bufsize > mss) {
|
if ((int) bufsize > mss) {
|
||||||
bufsize = roundup(bufsize, mss);
|
bufsize = roundup(bufsize, mss);
|
||||||
if (bufsize > sb_max)
|
if (bufsize > sb_max)
|
||||||
bufsize = sb_max;
|
bufsize = sb_max;
|
||||||
@@ -1722,7 +1725,7 @@ void tcp_mss_update(struct tcpcb *tp)
|
|||||||
* the slow start threshhold, but set the
|
* the slow start threshhold, but set the
|
||||||
* threshold to no less than 2*mss.
|
* threshold to no less than 2*mss.
|
||||||
*/
|
*/
|
||||||
tp->snd_ssthresh = max(2 * mss, rt->rt_rmx.rmx_ssthresh);
|
tp->snd_ssthresh = max(2 * mss, (int) rt->rt_rmx.rmx_ssthresh);
|
||||||
}
|
}
|
||||||
#endif /* RTV_MTU */
|
#endif /* RTV_MTU */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,13 +110,13 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (offer)
|
if (offer)
|
||||||
mss = min(mss, offer);
|
mss = min(mss, (int) offer);
|
||||||
|
|
||||||
mss = max(mss, 32);
|
mss = max(mss, 32);
|
||||||
if (mss < tp->t_maxseg || offer != 0) {
|
if (mss < tp->t_maxseg || offer != 0) {
|
||||||
if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
|
if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
|
||||||
bufsize = so->so_snd.sb_hiwat;
|
bufsize = so->so_snd.sb_hiwat;
|
||||||
if (bufsize < mss)
|
if ((int) bufsize < mss)
|
||||||
mss = bufsize;
|
mss = bufsize;
|
||||||
else {
|
else {
|
||||||
bufsize = roundup(bufsize, mss);
|
bufsize = roundup(bufsize, mss);
|
||||||
@@ -128,7 +128,7 @@ else
|
|||||||
|
|
||||||
if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
|
if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
|
||||||
bufsize = so->so_rcv.sb_hiwat;
|
bufsize = so->so_rcv.sb_hiwat;
|
||||||
if (bufsize > mss) {
|
if ((int) bufsize > mss) {
|
||||||
bufsize = roundup(bufsize, mss);
|
bufsize = roundup(bufsize, mss);
|
||||||
if (bufsize > sb_max)
|
if (bufsize > sb_max)
|
||||||
bufsize = sb_max;
|
bufsize = sb_max;
|
||||||
@@ -137,7 +137,7 @@ else
|
|||||||
}
|
}
|
||||||
tp->snd_cwnd = mss;
|
tp->snd_cwnd = mss;
|
||||||
if (rt->rt_rmx.rmx_ssthresh) {
|
if (rt->rt_rmx.rmx_ssthresh) {
|
||||||
tp->snd_ssthresh = max(2 * mss, rt->rt_rmx.rmx_ssthresh);
|
tp->snd_ssthresh = max(2 * mss, (int) rt->rt_rmx.rmx_ssthresh);
|
||||||
}
|
}
|
||||||
return mss;
|
return mss;
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ again:
|
|||||||
goto send;
|
goto send;
|
||||||
if (tp->t_force)
|
if (tp->t_force)
|
||||||
goto send;
|
goto send;
|
||||||
if (len >= tp->max_sndwnd / 2)
|
if (len >= (int) tp->max_sndwnd / 2)
|
||||||
goto send;
|
goto send;
|
||||||
if (SEQ_LT(tp->snd_nxt, tp->snd_max))
|
if (SEQ_LT(tp->snd_nxt, tp->snd_max))
|
||||||
goto send;
|
goto send;
|
||||||
@@ -235,7 +235,7 @@ again:
|
|||||||
(tp->rcv_adv - tp->rcv_nxt);
|
(tp->rcv_adv - tp->rcv_nxt);
|
||||||
if (adv >= (int32)(2 * tp->t_maxseg))
|
if (adv >= (int32)(2 * tp->t_maxseg))
|
||||||
goto send;
|
goto send;
|
||||||
if (2 * adv >= (int32)so->so_rcv.sb_hiwat)
|
if (2 * adv >= (int32) so->so_rcv.sb_hiwat)
|
||||||
goto send;
|
goto send;
|
||||||
}
|
}
|
||||||
if (tp->t_flags & TF_ACKNOW)
|
if (tp->t_flags & TF_ACKNOW)
|
||||||
@@ -294,7 +294,7 @@ send:
|
|||||||
}
|
}
|
||||||
hdrlen += optlen;
|
hdrlen += optlen;
|
||||||
|
|
||||||
if (len > tp->t_maxseg - optlen) {
|
if (len > (int) (tp->t_maxseg - optlen)) {
|
||||||
len = tp->t_maxseg - optlen;
|
len = tp->t_maxseg - optlen;
|
||||||
sendalot = 1;
|
sendalot = 1;
|
||||||
}
|
}
|
||||||
@@ -317,7 +317,7 @@ send:
|
|||||||
}
|
}
|
||||||
m->m_data += get_max_linkhdr();
|
m->m_data += get_max_linkhdr();
|
||||||
m->m_len = hdrlen;
|
m->m_len = hdrlen;
|
||||||
if (len <= MHLEN - hdrlen - get_max_linkhdr()) {
|
if (len <= (int) (MHLEN - hdrlen - get_max_linkhdr())) {
|
||||||
m_copydata(so->so_snd.sb_mb, off, (int)len, mtod(m, caddr_t) + hdrlen);
|
m_copydata(so->so_snd.sb_mb, off, (int)len, mtod(m, caddr_t) + hdrlen);
|
||||||
m->m_len += len;
|
m->m_len += len;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user