less memory usage improvements
This commit is contained in:
parent
326016b565
commit
aa4a347bfb
10
ipv6.ino
10
ipv6.ino
@ -82,13 +82,11 @@ void IPv6Packet::setDstAddress(IPv6Addr& address) {
|
|||||||
void IPv6Packet::setPayload(char* payload, int len) {
|
void IPv6Packet::setPayload(char* payload, int len) {
|
||||||
memset(packet, 0, LEN);
|
memset(packet, 0, LEN);
|
||||||
|
|
||||||
ipv6_packet_header* header = (ipv6_packet_header*)packet;
|
*(packet) = 0x60; /* IP version 6 */
|
||||||
memcpy(header->field, "\x60\x00\x00\x00", 4);
|
*(packet + 4 + 1) = len & 0xff; /* length */
|
||||||
|
*(packet + 7) = 64; /* hop limit / ttl */
|
||||||
|
|
||||||
memcpy(header->len + 1, (char*)&len, 1);
|
memcpy(packet + 40, payload, len); /* actual payload */
|
||||||
header->hop_limit = 64;
|
|
||||||
|
|
||||||
memcpy(packet + sizeof(ipv6_packet_header), payload, len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPv6Packet::doAction() {
|
void IPv6Packet::doAction() {
|
||||||
|
Loading…
Reference in New Issue
Block a user