mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 21:54:57 +02:00
Merge branch 'psd'
This commit is contained in:
@@ -102,8 +102,9 @@ static inline int hashfunc(struct in_addr addr)
|
|||||||
static bool
|
static bool
|
||||||
xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
|
xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
|
||||||
{
|
{
|
||||||
struct iphdr *iph;
|
const struct iphdr *iph;
|
||||||
struct tcphdr *tcph;
|
const struct tcphdr *tcph;
|
||||||
|
struct tcphdr _tcph;
|
||||||
struct in_addr addr;
|
struct in_addr addr;
|
||||||
u_int16_t src_port,dest_port;
|
u_int16_t src_port,dest_port;
|
||||||
u_int8_t tcp_flags, proto;
|
u_int8_t tcp_flags, proto;
|
||||||
@@ -117,7 +118,7 @@ xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
|
|||||||
iph = ip_hdr(pskb);
|
iph = ip_hdr(pskb);
|
||||||
|
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
if (ntohs(iph->frag_off) & IP_OFFSET) {
|
if (iph->frag_off & htons(IP_OFFSET)) {
|
||||||
pr_debug("sanity check failed\n");
|
pr_debug("sanity check failed\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -134,7 +135,9 @@ xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
|
|||||||
|
|
||||||
addr.s_addr = iph->saddr;
|
addr.s_addr = iph->saddr;
|
||||||
|
|
||||||
tcph = (void *)iph + ip_hdrlen(pskb);
|
tcph = skb_header_pointer(pskb, match->thoff, sizeof(_tcph), &_tcph);
|
||||||
|
if (tcph == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* Yep, it's dirty */
|
/* Yep, it's dirty */
|
||||||
src_port = tcph->source;
|
src_port = tcph->source;
|
||||||
|
Reference in New Issue
Block a user