Networking: Replace all references to the macros net_ipaddr_copy, net_ipaddr_hdrcopy, net_ipaddr_cmp, net_ipaddr_hdrcmp, and net_ipaddr_maskcmp with the appropriate IPv4 or IPv6 version of the macro (such as net_ipv4addr_copy). The goal is to support both IPv4 and IPv6 simultaneously. This requires that the macros be distinct and not conditionally defined to one on or the other.

This commit is contained in:
Gregory Nutt
2015-01-16 13:01:08 -06:00
parent 27c95e7775
commit 2663538b0a
15 changed files with 95 additions and 102 deletions
+2 -2
View File
@@ -251,7 +251,7 @@ FAR struct igmp_group_s *igmp_grpalloc(FAR struct net_driver_s *dev,
{
/* Initialize the non-zero elements of the group structure */
net_ipaddr_copy(group->grpaddr, *addr);
net_ipv4addr_copy(group->grpaddr, *addr);
sem_init(&group->sem, 0, 0);
/* Initialize the group timer (but don't start it yet) */
@@ -301,7 +301,7 @@ FAR struct igmp_group_s *igmp_grpfind(FAR struct net_driver_s *dev,
group = group->next)
{
grplldbg("Compare: %08x vs. %08x\n", group->grpaddr, *addr);
if (net_ipaddr_cmp(group->grpaddr, *addr))
if (net_ipv4addr_cmp(group->grpaddr, *addr))
{
grplldbg("Match!\n");
break;
+2 -2
View File
@@ -165,7 +165,7 @@ void igmp_input(struct net_driver_s *dev)
/* Check if the query was sent to all systems */
if (net_ipaddr_cmp(destipaddr, g_ipv4_allsystems))
if (net_ipv4addr_cmp(destipaddr, g_ipv4_allsystems))
{
/* Yes... Now check the if this this is a general or a group
* specific query.
@@ -206,7 +206,7 @@ void igmp_input(struct net_driver_s *dev)
{
/* Skip over the all systems group entry */
if (!net_ipaddr_cmp(member->grpaddr, g_ipv4_allsystems))
if (!net_ipv4addr_cmp(member->grpaddr, g_ipv4_allsystems))
{
ticks = net_dsec2tick((int)IGMPBUF->maxresp);
if (IS_IDLEMEMBER(member->flags) ||
+3 -3
View File
@@ -155,8 +155,8 @@ void igmp_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group,
IGMPBUF->ttl = IGMP_TTL;
IGMPBUF->proto = IP_PROTO_IGMP;
net_ipaddr_hdrcopy(IGMPBUF->srcipaddr, &dev->d_ipaddr);
net_ipaddr_hdrcopy(IGMPBUF->destipaddr, destipaddr);
net_ipv4addr_hdrcopy(IGMPBUF->srcipaddr, &dev->d_ipaddr);
net_ipv4addr_hdrcopy(IGMPBUF->destipaddr, destipaddr);
/* Calculate IP checksum. */
@@ -167,7 +167,7 @@ void igmp_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group,
IGMPBUF->type = group->msgid;
IGMPBUF->maxresp = 0;
net_ipaddr_hdrcopy(IGMPBUF->grpaddr, &group->grpaddr);
net_ipv4addr_hdrcopy(IGMPBUF->grpaddr, &group->grpaddr);
/* Calculate the IGMP checksum. */