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:
Sylvain Rochet 2015-03-20 20:11:59 +01:00
parent a4d14fc987
commit f7a5b71dba

View File

@ -994,8 +994,8 @@ nd6_send_rs(struct netif * netif)
if (src_addr != IP6_ADDR_ANY) {
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);
if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) {
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)))) {
/* We couldn't allocate a suitable pbuf for the ns. drop it. */
if (p != NULL) {
pbuf_free(p);