X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=utcp.c;h=ce056904169c6923baa95a0e5435626e5da75fd5;hb=f268b8518415a5cf896e1b3518c2a0141d1364d4;hp=7624aa576d39c8753c810cea4c4f8643c377d3d4;hpb=5d6a4bd71c683042495038e9679cbf7c80d816fd;p=utcp diff --git a/utcp.c b/utcp.c index 7624aa5..ce05690 100644 --- a/utcp.c +++ b/utcp.c @@ -282,7 +282,12 @@ static struct utcp_connection *allocate_connection(struct utcp *utcp, uint16_t s c->src = src; c->dst = dst; +#ifdef UTCP_DEBUG +#warning debugging + c->snd.iss = 0; +#else c->snd.iss = rand(); +#endif c->snd.una = c->snd.iss; c->snd.nxt = c->snd.iss + 1; c->rcv.wnd = utcp->mtu; @@ -360,7 +365,7 @@ static void ack(struct utcp_connection *c, bool sendatleastone) { } *pkt; pkt = malloc(sizeof pkt->hdr + c->utcp->mtu); - if(!pkt->data) + if(!pkt) return; pkt->hdr.src = c->src;