aboutsummaryrefslogtreecommitdiff
path: root/slirp/tcp_input.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-07 15:32:56 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-07 15:32:56 +0000
commit511d2b140f3ff2f80d14637cdc2f29743a2daa51 (patch)
tree6cf21d1c95846f1c86879c60dffbe6a3eaa8aa6d /slirp/tcp_input.c
parentc2764719914ff0c4d6c06adafea17629600f21ba (diff)
downloadqemu-511d2b140f3ff2f80d14637cdc2f29743a2daa51.zip
qemu-511d2b140f3ff2f80d14637cdc2f29743a2daa51.tar.gz
qemu-511d2b140f3ff2f80d14637cdc2f29743a2daa51.tar.bz2
Sparse fixes: NULL use, header order, ANSI prototypes, static
Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp/tcp_input.c')
-rw-r--r--slirp/tcp_input.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index d7805b5..effedfc 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -121,10 +121,10 @@ tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti,
int flags;
/*
- * Call with ti==0 after become established to
+ * Call with ti==NULL after become established to
* force pre-ESTABLISHED data up to user socket.
*/
- if (ti == 0)
+ if (ti == NULL)
goto present;
/*
@@ -230,19 +230,16 @@ present:
* protocol specification dated September, 1981 very closely.
*/
void
-tcp_input(m, iphlen, inso)
- register struct mbuf *m;
- int iphlen;
- struct socket *inso;
+tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
{
struct ip save_ip, *ip;
register struct tcpiphdr *ti;
caddr_t optp = NULL;
int optlen = 0;
int len, tlen, off;
- register struct tcpcb *tp = 0;
+ register struct tcpcb *tp = NULL;
register int tiflags;
- struct socket *so = 0;
+ struct socket *so = NULL;
int todrop, acked, ourfinisacked, needoutput = 0;
/* int dropsocket = 0; */
int iss = 0;
@@ -264,7 +261,7 @@ tcp_input(m, iphlen, inso)
/* Re-set a few variables */
tp = sototcpcb(so);
m = so->so_m;
- so->so_m = 0;
+ so->so_m = NULL;
ti = so->so_ti;
tiwin = ti->ti_win;
tiflags = ti->ti_flags;
@@ -298,8 +295,8 @@ tcp_input(m, iphlen, inso)
* Checksum extended TCP header and data.
*/
tlen = ((struct ip *)ti)->ip_len;
- tcpiphdr2qlink(ti)->next = tcpiphdr2qlink(ti)->prev = 0;
- memset(&ti->ti_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));
+ tcpiphdr2qlink(ti)->next = tcpiphdr2qlink(ti)->prev = NULL;
+ memset(&ti->ti_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));
ti->ti_x1 = 0;
ti->ti_len = htons((u_int16_t)tlen);
len = sizeof(struct ip ) + tlen;
@@ -399,7 +396,7 @@ findso:
* the only flag set, then create a session, mark it
* as if it was LISTENING, and continue...
*/
- if (so == 0) {
+ if (so == NULL) {
if ((tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) != TH_SYN)
goto dropwithreset;
@@ -439,7 +436,7 @@ findso:
tp = sototcpcb(so);
/* XXX Should never fail */
- if (tp == 0)
+ if (tp == NULL)
goto dropwithreset;
if (tp->t_state == TCPS_CLOSED)
goto drop;
@@ -1697,9 +1694,7 @@ tcp_xmit_timer(register struct tcpcb *tp, int rtt)
*/
int
-tcp_mss(tp, offer)
- register struct tcpcb *tp;
- u_int offer;
+tcp_mss(struct tcpcb *tp, u_int offer)
{
struct socket *so = tp->t_socket;
int mss;