Use common macro(s) for calculating link layer header length. From Brennan Ashton.

This commit is contained in:
Gregory Nutt
2015-04-13 13:53:13 -06:00
parent 3d6161a7aa
commit 7a745c3fa4
6 changed files with 50 additions and 33 deletions
+2 -7
View File
@@ -178,13 +178,8 @@ int ipv6_input(FAR struct net_driver_s *dev)
* headers.
*/
#if defined(CONFIG_NET_MULTILINK)
pktlen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN + dev->d_llhdrlen;
#elif defined(CONFIG_NET_ETHERNET)
pktlen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN + ETH_HDRLEN;
#else /* if defined(CONFIG_NET_SLIP) */
pktlen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN;
#endif
pktlen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN + netdev_ip +
netdev_ipv6_hdrlen(dev);
if (pktlen <= dev->d_len)
{