lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] ipv6 processing - solicited node address processing


From: Enrico Lehmann
Subject: Re: [lwip-devel] ipv6 processing - solicited node address processing
Date: Sat, 28 Apr 2012 23:17:29 +0200

> Next part:
> 
> > A second thing correspond to the Solicited-Node-Multicast Address.
> > Shouldn't the last 24 Bits matched to the netif's configured addresses?
> > This would immediately stop further processing and therefore save
> > processing time and is much faster, since it would omit icmp6_input()
> and
> > nd6_input() processing.
> 
> The default is to configure addresses using MAC for IID, therefore by
> default the las 24 bits would match the MAC. But this is only default and
> not mandatory, I often use simple addresses such as fe80::1. So that's why
> we go the longer route of joining a MLD group on the solicited node
> multicast address, and when a packet is received we check if we belong to
> the group.
> 


That's in fact true when using MLD protocol. So you check if a incoming packet 
is assigned to a multicast address and further belongs to a MLD group. If not 
the netif is NULL and the packet is discarded.

I'm not using the MLD protocol. So a multicast packet is recognized as such one 
and further recognized that it is assigned to a solicited node multicast 
address. Whats happen now is that nevertheless it matches to any of the netif's 
configured addresses the netif is set to input netif and the packet is 
processed further. So it is processed by icmp6_input() and nd6_input() and 
later discarded there.
When not using MLD I would suggest the following:

//this is your code
else if (ip6_addr_issolicitednode(ip6_current_dest_addr())) {
//suggestion starts here
    for(netif = netif_list; netif != NULL; netif = netif->next) { 
      for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
        if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) &&
            ip6_addr_match_solicitednode(current_src_addr(), 
netif_ip6_addr(netif, i))) {
                        LWIP_DEBUGF(IP6_ELE_DEBUG, ("solicited node mcast 
addr\r\n"));
            netif = inp;
                        break;
        }
      }
    }
}

The function 'ip6_addr_match_solicitednode()' could be implemented as macro 
(match the last 24 Bits).
This solution would also respect the gateway behaviour :-). If not required, 
just the configured addresses of the input netif could be checked.

> This approach supports multiple addresses with different solicited node
> multicast addresses.

The described suggestion would also support multiple addresses with different 
solicited node multicast addresses. This also applies to IPv6 addresses that 
are not based on a MAC address (I know that since I also have such addresses 
that are not based on the MAC address).

> 
> Cheers
> Ivan
> 

Ciao,
Enrico
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



reply via email to

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