mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-30 12:32:37 +00:00
PPP, PPPoE, removed global static buffer only used for debug
pppoe_error_tmp[] was only used in one function and only for debug purposes, moved to stack.
This commit is contained in:
parent
3ce6dd166c
commit
9de1c71ff7
@ -109,11 +109,7 @@
|
|||||||
#define IFF_PASSIVE IFF_LINK0 /* wait passively for connection */
|
#define IFF_PASSIVE IFF_LINK0 /* wait passively for connection */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: we should probably remove that, this is only used for debug purposes */
|
|
||||||
#ifndef PPPOE_ERRORSTRING_LEN
|
|
||||||
#define PPPOE_ERRORSTRING_LEN 64
|
#define PPPOE_ERRORSTRING_LEN 64
|
||||||
#endif
|
|
||||||
static char pppoe_error_tmp[PPPOE_ERRORSTRING_LEN];
|
|
||||||
|
|
||||||
|
|
||||||
/* callbacks called from PPP core */
|
/* callbacks called from PPP core */
|
||||||
@ -503,16 +499,19 @@ pppoe_disc_input(struct netif *netif, struct pbuf *pb)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if PPP_DEBUG
|
||||||
if (NULL != err_msg) {
|
if (NULL != err_msg) {
|
||||||
if (len) {
|
if (len) {
|
||||||
u16_t error_len = LWIP_MIN(len, sizeof(pppoe_error_tmp)-1);
|
char error_tmp[PPPOE_ERRORSTRING_LEN];
|
||||||
strncpy(pppoe_error_tmp, (char*)pb->payload + off + sizeof(pt), error_len);
|
u16_t error_len = LWIP_MIN(len, sizeof(error_tmp)-1);
|
||||||
pppoe_error_tmp[error_len] = '\0';
|
strncpy(error_tmp, (char*)pb->payload + off + sizeof(pt), error_len);
|
||||||
PPPDEBUG(LOG_DEBUG, ("%s: %s: %s\n", devname, err_msg, pppoe_error_tmp));
|
error_tmp[error_len] = '\0';
|
||||||
|
PPPDEBUG(LOG_DEBUG, ("%s: %s: %s\n", devname, err_msg, error_tmp));
|
||||||
} else {
|
} else {
|
||||||
PPPDEBUG(LOG_DEBUG, ("%s: %s\n", devname, err_msg));
|
PPPDEBUG(LOG_DEBUG, ("%s: %s\n", devname, err_msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* PPP_DEBUG */
|
||||||
off += sizeof(pt) + len;
|
off += sizeof(pt) + len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user