Skip to content

Commit 7a6b1c4

Browse files
author
Jan Engelhardt
committed
netfilter: xtables: remove another level of indent
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
1 parent 9452258 commit 7a6b1c4

File tree

3 files changed

+63
-66
lines changed

3 files changed

+63
-66
lines changed

net/ipv4/netfilter/arp_tables.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -313,23 +313,24 @@ unsigned int arpt_do_table(struct sk_buff *skb,
313313
}
314314

315315
e = get_entry(table_base, v);
316-
} else {
317-
/* Targets which reenter must return
318-
* abs. verdicts
319-
*/
320-
tgpar.target = t->u.kernel.target;
321-
tgpar.targinfo = t->data;
322-
verdict = t->u.kernel.target->target(skb, &tgpar);
323-
324-
/* Target might have changed stuff. */
325-
arp = arp_hdr(skb);
326-
327-
if (verdict == ARPT_CONTINUE)
328-
e = arpt_next_entry(e);
329-
else
330-
/* Verdict */
331-
break;
316+
continue;
332317
}
318+
319+
/* Targets which reenter must return
320+
* abs. verdicts
321+
*/
322+
tgpar.target = t->u.kernel.target;
323+
tgpar.targinfo = t->data;
324+
verdict = t->u.kernel.target->target(skb, &tgpar);
325+
326+
/* Target might have changed stuff. */
327+
arp = arp_hdr(skb);
328+
329+
if (verdict == ARPT_CONTINUE)
330+
e = arpt_next_entry(e);
331+
else
332+
/* Verdict */
333+
break;
333334
} while (!hotdrop);
334335
xt_info_rdunlock_bh();
335336

net/ipv4/netfilter/ip_tables.c

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -402,37 +402,35 @@ ipt_do_table(struct sk_buff *skb,
402402
}
403403

404404
e = get_entry(table_base, v);
405-
} else {
406-
/* Targets which reenter must return
407-
abs. verdicts */
408-
tgpar.target = t->u.kernel.target;
409-
tgpar.targinfo = t->data;
405+
continue;
406+
}
407+
408+
/* Targets which reenter must return
409+
abs. verdicts */
410+
tgpar.target = t->u.kernel.target;
411+
tgpar.targinfo = t->data;
410412
#ifdef CONFIG_NETFILTER_DEBUG
411-
((struct ipt_entry *)table_base)->comefrom
412-
= 0xeeeeeeec;
413+
((struct ipt_entry *)table_base)->comefrom = 0xeeeeeeec;
413414
#endif
414-
verdict = t->u.kernel.target->target(skb, &tgpar);
415+
verdict = t->u.kernel.target->target(skb, &tgpar);
415416
#ifdef CONFIG_NETFILTER_DEBUG
416-
if (((struct ipt_entry *)table_base)->comefrom
417-
!= 0xeeeeeeec
418-
&& verdict == IPT_CONTINUE) {
419-
printk("Target %s reentered!\n",
420-
t->u.kernel.target->name);
421-
verdict = NF_DROP;
422-
}
423-
((struct ipt_entry *)table_base)->comefrom
424-
= 0x57acc001;
425-
#endif
426-
/* Target might have changed stuff. */
427-
ip = ip_hdr(skb);
428-
datalen = skb->len - ip->ihl * 4;
429-
430-
if (verdict == IPT_CONTINUE)
431-
e = ipt_next_entry(e);
432-
else
433-
/* Verdict */
434-
break;
417+
if (((struct ipt_entry *)table_base)->comefrom != 0xeeeeeeec &&
418+
verdict == IPT_CONTINUE) {
419+
printk("Target %s reentered!\n",
420+
t->u.kernel.target->name);
421+
verdict = NF_DROP;
435422
}
423+
((struct ipt_entry *)table_base)->comefrom = 0x57acc001;
424+
#endif
425+
/* Target might have changed stuff. */
426+
ip = ip_hdr(skb);
427+
datalen = skb->len - ip->ihl * 4;
428+
429+
if (verdict == IPT_CONTINUE)
430+
e = ipt_next_entry(e);
431+
else
432+
/* Verdict */
433+
break;
436434
} while (!hotdrop);
437435
xt_info_rdunlock_bh();
438436

net/ipv6/netfilter/ip6_tables.c

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -431,35 +431,33 @@ ip6t_do_table(struct sk_buff *skb,
431431
}
432432

433433
e = get_entry(table_base, v);
434-
} else {
435-
/* Targets which reenter must return
436-
abs. verdicts */
437-
tgpar.target = t->u.kernel.target;
438-
tgpar.targinfo = t->data;
434+
continue;
435+
}
436+
437+
/* Targets which reenter must return
438+
abs. verdicts */
439+
tgpar.target = t->u.kernel.target;
440+
tgpar.targinfo = t->data;
439441

440442
#ifdef CONFIG_NETFILTER_DEBUG
441-
((struct ip6t_entry *)table_base)->comefrom
442-
= 0xeeeeeeec;
443+
((struct ip6t_entry *)table_base)->comefrom = 0xeeeeeeec;
443444
#endif
444-
verdict = t->u.kernel.target->target(skb, &tgpar);
445+
verdict = t->u.kernel.target->target(skb, &tgpar);
445446

446447
#ifdef CONFIG_NETFILTER_DEBUG
447-
if (((struct ip6t_entry *)table_base)->comefrom
448-
!= 0xeeeeeeec
449-
&& verdict == IP6T_CONTINUE) {
450-
printk("Target %s reentered!\n",
451-
t->u.kernel.target->name);
452-
verdict = NF_DROP;
453-
}
454-
((struct ip6t_entry *)table_base)->comefrom
455-
= 0x57acc001;
456-
#endif
457-
if (verdict == IP6T_CONTINUE)
458-
e = ip6t_next_entry(e);
459-
else
460-
/* Verdict */
461-
break;
448+
if (((struct ip6t_entry *)table_base)->comefrom != 0xeeeeeeec &&
449+
verdict == IP6T_CONTINUE) {
450+
printk("Target %s reentered!\n",
451+
t->u.kernel.target->name);
452+
verdict = NF_DROP;
462453
}
454+
((struct ip6t_entry *)table_base)->comefrom = 0x57acc001;
455+
#endif
456+
if (verdict == IP6T_CONTINUE)
457+
e = ip6t_next_entry(e);
458+
else
459+
/* Verdict */
460+
break;
463461
} while (!hotdrop);
464462

465463
#ifdef CONFIG_NETFILTER_DEBUG

0 commit comments

Comments
 (0)