mirror of
https://github.com/apache/nuttx.git
synced 2026-09-20 21:06:58 +08:00
net/mld: Fix some compile errors fill debug info is enabled. Fix some errors in formatting the Listerner report. Still has a checksum error.
This commit is contained in:
@@ -164,6 +164,7 @@ struct ipv6_extension_s
|
||||
{
|
||||
uint8_t nxthdr; /* Next header */
|
||||
uint8_t len; /* Extension header length */
|
||||
uint8_t pad[6]; /* Pad to a multiple of 8 bytes */
|
||||
};
|
||||
|
||||
/* Hop-by-hop Option Header */
|
||||
@@ -220,6 +221,7 @@ struct ipv6_router_alert_s
|
||||
uint8_t type; /* Hop-by-hop option number (5) */
|
||||
uint8_t len; /* Length = 2 */
|
||||
uint16_t value; /* Value. See OPT_RA_* Definitions */
|
||||
uint8_t pad[4]; /* Pad to a multiple of 8 bytes */
|
||||
};
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_NET_IPV6EXT_H */
|
||||
|
||||
@@ -141,8 +141,6 @@ void igmp_poll(FAR struct net_driver_s *dev)
|
||||
{
|
||||
FAR struct igmp_group_s *group;
|
||||
|
||||
ninfo("Entry\n");
|
||||
|
||||
/* Setup the poll operation */
|
||||
|
||||
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPIGMP_HDRLEN];
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ int mld_joingroup(FAR const struct ipv6_mreq *mrec)
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[4],
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[5],
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[5],
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[7);
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[7]);
|
||||
|
||||
/* Check if a this address is already in the group */
|
||||
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ int mld_leavegroup(FAR const struct ipv6_mreq *mrec)
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[4],
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[5],
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[5],
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[7);
|
||||
mrec->ipv6mr_multiaddr.s6_addr16[7]);
|
||||
|
||||
/* Find the entry corresponding to the address leaving the group */
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ static void mld_mcastmac(FAR const net_ipv6addr_t ipaddr, FAR uint8_t *mac)
|
||||
ninfo("Mcast IP: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
|
||||
ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3],
|
||||
ipaddr[4], ipaddr[5], ipaddr[6], ipaddr[7]);
|
||||
ninfo("IP: 0")
|
||||
|
||||
/* For the MAC address by insert the low 32 Bits of the multicast IPv6
|
||||
* Address into the Ethernet Address . This mapping is from the IETF
|
||||
|
||||
@@ -95,8 +95,6 @@ void mld_poll(FAR struct net_driver_s *dev)
|
||||
{
|
||||
FAR struct mld_group_s *group;
|
||||
|
||||
ninfo("Entry\n");
|
||||
|
||||
/* Setup the poll operation */
|
||||
|
||||
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN];
|
||||
|
||||
+11
-6
@@ -78,16 +78,16 @@
|
||||
|
||||
#define IPv6BUF ((FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
|
||||
#define RABUF ((FAR struct ipv6_router_alert_s *) \
|
||||
&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN)
|
||||
(&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN))
|
||||
#define RASIZE sizeof(struct ipv6_router_alert_s)
|
||||
#define QUERYBUF ((FAR struct mld_mcast_listen_query_s *) \
|
||||
&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE)
|
||||
(&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE))
|
||||
#define V1REPORTBUF ((FAR struct mld_mcast_listen_report_v1_s *) \
|
||||
&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE)
|
||||
(&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE))
|
||||
#define V2REPORTBUF ((FAR struct mld_mcast_listen_report_v2_s *) \
|
||||
&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE)
|
||||
(&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE))
|
||||
#define DONEBUF ((FAR struct mld_mcast_listen_done_v1_s *) \
|
||||
&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE)
|
||||
(&dev->d_buf[NET_LL_HDRLEN(dev)] + IPv6_HDRLEN + RASIZE))
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -224,6 +224,9 @@ void mld_send(FAR struct net_driver_s *dev, FAR struct mld_group_s *group,
|
||||
case MLD_SEND_V1DONE: /* Send MLDv1 Done message */
|
||||
destipaddr = g_ipv6_allrouters;
|
||||
break;
|
||||
|
||||
default: /* Can't happen, but eliminates a warning */
|
||||
return;
|
||||
}
|
||||
|
||||
ninfo("destipaddr: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
|
||||
@@ -243,7 +246,6 @@ void mld_send(FAR struct net_driver_s *dev, FAR struct mld_group_s *group,
|
||||
ra->hbyh.nxthdr = IP_PROTO_ICMP6; /* ICMPv6 payload follows extension header */
|
||||
ra->hbyh.len = 1; /* One 8-octet option follows */
|
||||
ra->type = HOPBYHOP_ROUTER_ALERT; /* Router alert */
|
||||
ra->len = 2; /* Length */
|
||||
|
||||
/* Format the MLD ICMPv6 payload into place after the IPv6 header (with
|
||||
* router alert)
|
||||
@@ -348,6 +350,9 @@ void mld_send(FAR struct net_driver_s *dev, FAR struct mld_group_s *group,
|
||||
MLD_STATINCR(g_netstats.mld.done_sent);
|
||||
}
|
||||
break;
|
||||
|
||||
default: /* Can't happen, but eliminates a warning */
|
||||
return;
|
||||
}
|
||||
|
||||
MLD_STATINCR(g_netstats.icmpv6.sent);
|
||||
|
||||
Reference in New Issue
Block a user