Skip to content

Commit

Permalink
Fix pppoe_softc_list
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed May 26, 2024
1 parent a7f913d commit f1da8f6
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/exploit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ int Exploit::stage2() {
if (option[0] != 1) return false; // type 1 is ICMPv6NDOptSrcLLAddr
if (option[1] > 1) {
auto *self = (Exploit *) cookie;
self->pppoe_softc_list = *(uint64_t * )(option + 3);
self->pppoe_softc_list = htole64(*(uint64_t * )(option + 3));
return true; // length > 1
}
return false;
Expand Down Expand Up @@ -1100,34 +1100,23 @@ int Exploit::run() {
return RETURN_SUCCESS;
}

template<auto M>
template<auto M, auto N>
struct Tunnel;

template<class T, class U, T U::*M>
struct Tunnel<M> {
template<class T, class V, class Q, class U, T U::*M, Q V::*N>
struct Tunnel<M, N> {
friend T &stopThread(U &u) {
return u.*M;
}
};

template
struct Tunnel<&pcpp::PcapLiveDevice::m_StopThread>;

std::atomic<bool> &stopThread(pcpp::PcapLiveDevice &);

template<auto M>
struct Tunnel2;

template<class T, class U, T U::*M>
struct Tunnel2<M> {
friend T &pcapHandle(U &u) {
return u.*M;
friend Q &pcapHandle(V &u) {
return u.*N;
}
};

template
struct Tunnel2<&pcpp::IPcapDevice::m_PcapDescriptor>;
struct Tunnel<&pcpp::PcapLiveDevice::m_StopThread, &pcpp::IPcapDevice::m_PcapDescriptor>;

std::atomic<bool> &stopThread(pcpp::PcapLiveDevice &);
pcap_t *&pcapHandle(pcpp::IPcapDevice &);

void Exploit::stop() {
Expand Down

0 comments on commit f1da8f6

Please sign in to comment.