Add uip_clear_buf() macro and replace all instances of uip_len = 0; with it

This commit is contained in:
Laurent Deru 2015-06-15 10:25:58 +02:00
parent cb09689846
commit 1784338b2e
30 changed files with 92 additions and 84 deletions

View file

@ -311,7 +311,7 @@ request_prefix(void)
uip_buf[1] = 'P';
uip_len = 2;
slip_send();
uip_len = 0;
uip_clear_buf();
}
/*---------------------------------------------------------------------------*/
void

View file

@ -59,7 +59,7 @@ slip_input_callback(void)
// PRINTF("SIN: %u\n", uip_len);
if(uip_buf[0] == '!') {
PRINTF("Got configuration message of type %c\n", uip_buf[1]);
uip_len = 0;
uip_clear_buf();
if(uip_buf[1] == 'P') {
uip_ipaddr_t prefix;
/* Here we set a prefix !!! */
@ -85,7 +85,7 @@ slip_input_callback(void)
slip_send();
}
uip_len = 0;
uip_clear_buf();
}
/* Save the last sender received over SLIP to avoid bouncing the
packet back if no route is found */