mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 20:55:13 +02:00
xt_psd: move early bail-out code above skb_header_pointer
This commit is contained in:
@@ -130,6 +130,12 @@ xt_psd_match(const struct sk_buff *pskb, struct xt_action_param *match)
|
||||
/* Get the source address, source & destination ports, and TCP flags */
|
||||
|
||||
addr.s_addr = iph->saddr;
|
||||
/* We're using IP address 0.0.0.0 for a special purpose here, so don't let
|
||||
* them spoof us. [DHCP needs this feature - HW] */
|
||||
if (addr.s_addr == 0) {
|
||||
pr_debug("spoofed source address (0.0.0.0)\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (proto == IPPROTO_TCP) {
|
||||
tcph = skb_header_pointer(pskb, match->thoff,
|
||||
@@ -154,13 +160,6 @@ xt_psd_match(const struct sk_buff *pskb, struct xt_action_param *match)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* We're using IP address 0.0.0.0 for a special purpose here, so don't let
|
||||
* them spoof us. [DHCP needs this feature - HW] */
|
||||
if (addr.s_addr == 0) {
|
||||
pr_debug("spoofed source address (0.0.0.0)\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Use jiffies here not to depend on someone setting the time while we're
|
||||
* running; we need to be careful with possible return value overflows. */
|
||||
now = jiffies;
|
||||
|
Reference in New Issue
Block a user