lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #56293] The callback API used to add or delete multica


From: Gao Qingshui
Subject: [lwip-devel] [bug #56293] The callback API used to add or delete multicast MAC filter entry need some optimization
Date: Thu, 9 May 2019 07:23:15 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36

URL:
  <https://savannah.nongnu.org/bugs/?56293>

                 Summary: The callback API used to add or delete multicast MAC
filter entry need some optimization
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: kevingao
            Submitted on: Thu 09 May 2019 11:23:13 AM UTC
                Category: Network drivers
                Severity: 3 - Normal
              Item Group: Change Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

Two optimizations could be implemented about the callback API used to add or
delete multicast MAC filter:
1,currently there are two callback APIs, igmp_mac_filter for IGMP and
mld_mac_filter for MLD, but one API is enough as the L2 layer does not
distinguish between IPv4 or IPv6;
2,the input argument could be changed from IP address to MAC address, this
could make the network driver prosssing simpler as it does not need to do IPv4
or IPv6 address mapping to MAC address.

so I recommend to change the prototype to below format for both IPv4 and
IPv6:

/************************************************************/
before change: 
#if LWIP_IPV4 && LWIP_IGMP
/** Function prototype for netif igmp_mac_filter functions */
typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
       const ip4_addr_t *group, enum netif_mac_filter_action action);
#endif /* LWIP_IPV4 && LWIP_IGMP */
#if LWIP_IPV6 && LWIP_IPV6_MLD
/** Function prototype for netif mld_mac_filter functions */
typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
       const ip6_addr_t *group, enum netif_mac_filter_action action);
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */

#if LWIP_IPV4 && LWIP_IGMP
  /** This function could be called to add or delete an entry in the multicast
filter table of the ethernet MAC.*/
  netif_igmp_mac_filter_fn igmp_mac_filter;
#endif /* LWIP_IPV4 && LWIP_IGMP */
#if LWIP_IPV6 && LWIP_IPV6_MLD
  /** This function could be called to add or delete an entry in the IPv6
multicast filter table of the ethernet MAC. */
  netif_mld_mac_filter_fn mld_mac_filter;
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */

/************************************************************/
after change:
#if (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD)
/** Function prototype for netif_mac_filter functions */
typedef err_t (*netif_mac_filter_fn)(struct netif *netif,
       const struct eth_addr *multi_mac, enum netif_mac_filter_action
action);
#endif /* (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD) */
#if (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD)
  /** This function could be called to add or delete an entry in the 
multicast filter table of the ethernet MAC. */
  netif_mac_filter_fn multicast_mac_filter;
#endif /* (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD) */




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56293>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]