buglwIP - A Lightweight TCP/IP stack - Bugs: bug #56293, The callback API used to add or...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56293: The callback API used to add or delete multicast MAC filter entry need some optimization

Submitted by:  Gao Qingshui <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 Planned Release:  None
lwIP version:  git head

Tue 14 May 2019 07:35:25 PM UTC, comment #2: 

Ping?

Simon Goldschmidt <goldsimon>
Project Administrator
Thu 09 May 2019 11:30:10 AM UTC, comment #1: 

For this and other bug entries you entered: it would be much easier to see what you mean and review the change if you attached a patch (i.e. commit your changes to your local tree, run "git format-patch -1 HEAD" and attach the resulting file here).

Simon Goldschmidt <goldsimon>
Project Administrator
Thu 09 May 2019 11:23:13 AM UTC, original submission:  

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) */

Gao Qingshui <kevingao>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by kevingao (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5