xt_SYSRQ: drop unprocessed packets

This commit is contained in:
Jan Engelhardt
2010-03-17 02:46:18 +01:00
parent 8dd316ed56
commit c9b4e9c518

View File

@@ -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);