mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2024-12-22 06:15:31 +00:00
Implement raw socket mask handling on application layer.
This commit is contained in:
parent
3e44760a88
commit
5379c0c584
@ -201,7 +201,6 @@ static int fallback_accept_packet(uint32_t id) {
|
||||
}
|
||||
|
||||
return MNL_CB_OK;
|
||||
|
||||
}
|
||||
|
||||
#define TLS_CONTENT_TYPE_HANDSHAKE 0x16
|
||||
@ -559,6 +558,7 @@ static int queue_cb(const struct nlmsghdr *nlh, void *data) {
|
||||
return MNL_CB_ERROR;
|
||||
}
|
||||
|
||||
|
||||
ph = mnl_attr_get_payload(attr[NFQA_PACKET_HDR]);
|
||||
|
||||
packet.id = ntohl(ph->packet_id);
|
||||
@ -580,6 +580,14 @@ static int queue_cb(const struct nlmsghdr *nlh, void *data) {
|
||||
return fallback_accept_packet(packet.id);
|
||||
}
|
||||
|
||||
if (attr[NFQA_MARK] != NULL) {
|
||||
// Skip packets sent by rawsocket to escape infinity loop.
|
||||
if (ntohl(mnl_attr_get_u32(attr[NFQA_MARK])) ==
|
||||
RAWSOCKET_MARK) {
|
||||
return fallback_accept_packet(packet.id);
|
||||
}
|
||||
}
|
||||
|
||||
return process_packet(packet);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user