/* identify the IP header */
ip6hdr = (struct ip6_hdr *)p->payload;
if (IP6H_V(ip6hdr) != 6) {
- LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IPv6 packet dropped due to bad version number %"U16_F"\n",
+ LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IPv6 packet dropped due to bad version number %"U32_F"\n",
IP6H_V(ip6hdr)));
pbuf_free(p);
IP6_STATS_INC(ip6.err);
}
#else /* LWIP_IPV6_MLD */
else if (ip6_addr_issolicitednode(ip6_current_dest_addr())) {
- /* Accept all solicited node packets when MLD is not enabled
+ /* Filter solicited node packets when MLD is not enabled
* (for Neighbor discovery). */
- netif = inp;
+ netif = NULL;
+ for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
+ if (ip6_addr_isvalid(netif_ip6_addr_state(inp, i)) &&
+ ip6_addr_cmp_solicitednode(ip6_current_dest_addr(), netif_ip6_addr(inp, i))) {
+ netif = inp;
+ LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: solicited node packet accepted on interface %c%c\n",
+ netif->name[0], netif->name[1]));
+ break;
+ }
+ }
}
#endif /* LWIP_IPV6_MLD */
else {
}
}
}
+ if (ip6_addr_islinklocal(ip6_current_dest_addr())) {
+ /* Do not match link-local addresses to other netifs. */
+ netif = NULL;
+ break;
+ }
if (first) {
first = 0;
netif = netif_list;
} while(netif != NULL);
netif_found:
LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet accepted on interface %c%c\n",
- netif->name[0], netif->name[1]));
+ netif ? netif->name[0] : 'X', netif? netif->name[1] : 'X'));
}
/* "::" packet source address? (used in duplicate address detection) */
u8_t hl, u8_t tc, u8_t nexth)
{
struct netif *netif;
+ struct ip6_hdr *ip6hdr;
ip6_addr_t src_addr, dest_addr;
/* pbufs passed to IPv6 must have a ref-count of 1 as their payload pointer
u8_t hl, u8_t tc, u8_t nexth, u8_t *addr_hint)
{
struct netif *netif;
+ struct ip6_hdr *ip6hdr;
+ ip6_addr_t src_addr, dest_addr;
err_t err;
/* pbufs passed to IP must have a ref-count of 1 as their payload pointer
IP6H_FL(ip6hdr)));
LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n"));
LWIP_DEBUGF(IP6_DEBUG, ("| %5"U16_F" | %3"U16_F" | %3"U16_F" | (plen, nexth, hopl)\n",
- ntohs(IP6H_PLEN(ip6hdr)),
- ntohs(IP6H_NEXTH(ip6hdr)),
- ntohs(IP6H_HOPLIM(ip6hdr))));
+ IP6H_PLEN(ip6hdr),
+ IP6H_NEXTH(ip6hdr),
+ IP6H_HOPLIM(ip6hdr)));
LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n"));
LWIP_DEBUGF(IP6_DEBUG, ("| %4"X32_F" | %4"X32_F" | %4"X32_F" | %4"X32_F" | (src)\n",
IP6_ADDR_BLOCK1(&(ip6hdr->src)),