Skip to content

Instantly share code, notes, and snippets.

@cmouse
Created July 2, 2013 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmouse/5907290 to your computer and use it in GitHub Desktop.
Save cmouse/5907290 to your computer and use it in GitHub Desktop.
case 0x87: // v6 ndp
buffer[ICMP6_O_TYPE] = 0x88; // reply
buffer[ICMP6_O_CODE] = 0x0;
*(uint32_t*)(buffer+ICMP6_O_DATA) = 0x40; // solicited
memcpy(buffer + ETH_O_SOURCE, config->mac, ETH_ALEN);
memcpy(buffer + IP6_O_DADDR, config->ip6_addr.s6_addr, 16);
memcpy(buffer + ICMP6_O_DATA + 4, config->ip6_addr.s6_addr, 16);
memcpy(buffer + ICMP6_O_DATA + 22, config->mac, 6);
buffer[ICMP6_O_DATA + 20] = 2;
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment