From c671f8e7efdeadeaccb4c6bb885da97a629c7f40 Mon Sep 17 00:00:00 2001 From: fbernon Date: Thu, 30 Aug 2007 15:48:14 +0000 Subject: [PATCH] Replace API programmation error checking for IGMP join/leave (ismulticast(addr)) by LWIP_ERROR checking. --- src/core/ipv4/igmp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/ipv4/igmp.c b/src/core/ipv4/igmp.c index 05825829..39d9adc4 100644 --- a/src/core/ipv4/igmp.c +++ b/src/core/ipv4/igmp.c @@ -340,10 +340,7 @@ igmp_joingroup(struct netif *ifp, struct ip_addr *groupaddr) struct igmp_group *group; /* make sure it is multicast address */ - if (!ip_addr_ismulticast(groupaddr)) { - LWIP_DEBUGF(IGMP_DEBUG, ("igmp_joingroup: attempt to join non-multicast address\n")); - return ERR_VAL; - } + LWIP_ERROR("igmp_joingroup: attempt to join non-multicast address", ip_addr_ismulticast(groupaddr), return ERR_VAL;); /* find group or create a new one if not found */ group = igmp_lookup_group(ifp, groupaddr); @@ -390,6 +387,10 @@ igmp_leavegroup(struct netif *ifp, struct ip_addr *groupaddr) { struct igmp_group *group; + /* make sure it is multicast address */ + LWIP_ERROR("igmp_leavegroup: attempt to leave non-multicast address", ip_addr_ismulticast(groupaddr), return ERR_VAL;); + + /* find group */ group = igmp_lookfor_group(ifp, groupaddr); if (group != NULL) {