mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-26 08:02:51 +00:00
nd6: fixed compiler warnings
nd6.c: In function ‘nd6_send_rs’: nd6.c:997:52: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses] p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len << 3, PBUF_RAM); ^ nd6.c:998:58: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses] if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) {
This commit is contained in:
parent
a4d14fc987
commit
f7a5b71dba
@ -994,8 +994,8 @@ nd6_send_rs(struct netif * netif)
|
|||||||
if (src_addr != IP6_ADDR_ANY) {
|
if (src_addr != IP6_ADDR_ANY) {
|
||||||
lladdr_opt_len = ((netif->hwaddr_len + 2) >> 3) + (((netif->hwaddr_len + 2) & 0x07) ? 1 : 0);
|
lladdr_opt_len = ((netif->hwaddr_len + 2) >> 3) + (((netif->hwaddr_len + 2) & 0x07) ? 1 : 0);
|
||||||
}
|
}
|
||||||
p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len << 3, PBUF_RAM);
|
p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + (lladdr_opt_len << 3), PBUF_RAM);
|
||||||
if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) {
|
if ((p == NULL) || (p->len < (sizeof(struct rs_header) + (lladdr_opt_len << 3)))) {
|
||||||
/* We couldn't allocate a suitable pbuf for the ns. drop it. */
|
/* We couldn't allocate a suitable pbuf for the ns. drop it. */
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
|
Loading…
Reference in New Issue
Block a user