mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-21 03:54:59 +02:00
xt_psd: cleanup and reduce number of condition checks
This commit is contained in:
@@ -127,12 +127,6 @@ xt_psd_match(const struct sk_buff *pskb, struct xt_action_param *match)
|
|||||||
|
|
||||||
/* TCP or UDP ? */
|
/* TCP or UDP ? */
|
||||||
proto = iph->protocol;
|
proto = iph->protocol;
|
||||||
|
|
||||||
if (proto != IPPROTO_TCP && proto != IPPROTO_UDP) {
|
|
||||||
pr_debug("protocol not supported\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the source address, source & destination ports, and TCP flags */
|
/* Get the source address, source & destination ports, and TCP flags */
|
||||||
|
|
||||||
addr.s_addr = iph->saddr;
|
addr.s_addr = iph->saddr;
|
||||||
@@ -155,6 +149,9 @@ xt_psd_match(const struct sk_buff *pskb, struct xt_action_param *match)
|
|||||||
src_port = udph->source;
|
src_port = udph->source;
|
||||||
dest_port = udph->dest;
|
dest_port = udph->dest;
|
||||||
tcp_flags = 0;
|
tcp_flags = 0;
|
||||||
|
} else {
|
||||||
|
pr_debug("protocol not supported\n");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We're using IP address 0.0.0.0 for a special purpose here, so don't let
|
/* We're using IP address 0.0.0.0 for a special purpose here, so don't let
|
||||||
|
Reference in New Issue
Block a user