X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=greprotocol.cpp;h=5fd4e4b8262a69be62098fb41524a2b228b7602f;hb=db5c35411fa6e348da943be860beffec71d304eb;hp=4a634156789f0aa3848d8ac1aaf5172a65d0bd4d;hpb=8e81c01b2de70c5e7e1a73d25ebbece0a95bd2c8;p=greproxy diff --git a/greprotocol.cpp b/greprotocol.cpp index 4a63415..5fd4e4b 100644 --- a/greprotocol.cpp +++ b/greprotocol.cpp @@ -1,9 +1,11 @@ +#include +#include +#include #include #include #include #include "greprotocol.h" -#include "reorderer.h" using namespace std; @@ -22,7 +24,6 @@ struct gre_header { GREProtocol::GREProtocol(const in6_addr &src, const in6_addr &dst) - : seq(0) { memset(&dstaddr, 0, sizeof(dstaddr)); dstaddr.sin6_family = AF_INET6; @@ -55,7 +56,7 @@ void GREProtocol::send_packet(uint16_t proto, const string &data, int incoming_s gre->protocol_type = htons(proto); char *ptr = buf + sizeof(*gre); - int seq_be = htonl(seq++); // Ignore incoming_seq. + int seq_be = htonl(incoming_seq); memcpy(ptr, &seq_be, sizeof(seq_be)); ptr += sizeof(seq_be); @@ -72,7 +73,7 @@ int GREProtocol::fd() const return sock; } -void GREProtocol::read_packet(Protocol *sender) +void GREProtocol::read_packet(Sender *sender) { struct sockaddr_storage addr; socklen_t addrlen = sizeof(addr);