mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-20 11:34:57 +02:00
xt_SYSRQ: drop unprocessed packets
This commit is contained in:
@@ -209,7 +209,7 @@ sysrq_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
|
|||||||
|
|
||||||
iph = ip_hdr(skb);
|
iph = ip_hdr(skb);
|
||||||
if (iph->protocol != IPPROTO_UDP && iph->protocol != IPPROTO_UDPLITE)
|
if (iph->protocol != IPPROTO_UDP && iph->protocol != IPPROTO_UDPLITE)
|
||||||
return NF_ACCEPT; /* sink it */
|
return NF_DROP;
|
||||||
|
|
||||||
udph = (const void *)iph + ip_hdrlen(skb);
|
udph = (const void *)iph + ip_hdrlen(skb);
|
||||||
len = ntohs(udph->len) - sizeof(struct udphdr);
|
len = ntohs(udph->len) - sizeof(struct udphdr);
|
||||||
@@ -239,7 +239,7 @@ sysrq_tg6(struct sk_buff **pskb, const struct xt_target_param *par)
|
|||||||
iph = ipv6_hdr(skb);
|
iph = ipv6_hdr(skb);
|
||||||
if (ipv6_find_hdr(skb, &th_off, IPPROTO_UDP, &frag_off) < 0 ||
|
if (ipv6_find_hdr(skb, &th_off, IPPROTO_UDP, &frag_off) < 0 ||
|
||||||
frag_off > 0)
|
frag_off > 0)
|
||||||
return NF_ACCEPT; /* sink it */
|
return NF_DROP;
|
||||||
|
|
||||||
udph = (const void *)iph + th_off;
|
udph = (const void *)iph + th_off;
|
||||||
len = ntohs(udph->len) - sizeof(struct udphdr);
|
len = ntohs(udph->len) - sizeof(struct udphdr);
|
||||||
|
Reference in New Issue
Block a user