mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2024-12-22 06:15:31 +00:00
Fix tcp4 frag error caused by enabled IP fragmentation
If the packet is fragmented here is no way to deal with it, but we don't care about DF flag in real
This commit is contained in:
parent
1b8d3a0e66
commit
c9949a3605
6
mangle.c
6
mangle.c
@ -226,7 +226,11 @@ int tcp4_frag(const __u8 *pkt, __u32 buflen, __u32 payload_offset,
|
||||
}
|
||||
|
||||
|
||||
if (!(ntohs(hdr->frag_off) & IP_DF)) {
|
||||
if (
|
||||
ntohs(hdr->frag_off) & IP_MF ||
|
||||
ntohs(hdr->frag_off) & IP_OFFMASK) {
|
||||
printf("tcp4_frag: frag value: %d\n",
|
||||
ntohs(hdr->frag_off));
|
||||
lgerror("tcp4_frag: ip fragmentation is set", -EINVAL);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ static int process_packet(const struct packet_data packet, struct queue_data qda
|
||||
mid_offset, frag1, &f1len, frag2, &f2len)) < 0) {
|
||||
errno = -ret;
|
||||
perror("tcp4_frag");
|
||||
goto send_verd;
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
#elif defined(USE_IP_FRAGMENTATION)
|
||||
@ -395,7 +395,7 @@ static int process_packet(const struct packet_data packet, struct queue_data qda
|
||||
mid_offset, frag1, &f1len, frag2, &f2len)) < 0) {
|
||||
errno = -ret;
|
||||
perror("ip4_frag");
|
||||
goto send_verd;
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -404,7 +404,7 @@ static int process_packet(const struct packet_data packet, struct queue_data qda
|
||||
errno = -ret;
|
||||
perror("raw pack send");
|
||||
}
|
||||
goto send_verd;
|
||||
goto fallback;
|
||||
#endif
|
||||
|
||||
ret = send_raw_socket(frag2, f2len);
|
||||
@ -412,7 +412,7 @@ static int process_packet(const struct packet_data packet, struct queue_data qda
|
||||
errno = -ret;
|
||||
perror("raw frags send: frag2");
|
||||
|
||||
goto send_verd;
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
#ifdef SEG2_DELAY
|
||||
@ -430,7 +430,7 @@ static int process_packet(const struct packet_data packet, struct queue_data qda
|
||||
errno = -ret;
|
||||
perror("raw frags send: frag1");
|
||||
|
||||
goto send_verd;
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user