From 85d1218f4108e0fe793f63e57e2edadd5da5764f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 18 Feb 2018 13:49:48 +0100 Subject: prog: rework foreachArg Make Foreach* callback accept the arg and a context struct that can contain lots of aux info. This (1) removes lots of unuser base/parent args, (2) provides foundation for stopping recursion, (3) allows to merge foreachSubargOffset. --- sys/linux/init_iptables.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/linux') diff --git a/sys/linux/init_iptables.go b/sys/linux/init_iptables.go index 89604e0b1..d0e776045 100644 --- a/sys/linux/init_iptables.go +++ b/sys/linux/init_iptables.go @@ -85,7 +85,7 @@ func (arch *arch) generateNetfilterTable(g *prog.Gen, typ prog.Type, old prog.Ar hookArg.Val = pos } // Now update standard target jump offsets. - prog.ForeachSubarg(arg, func(arg, _ prog.Arg, _ *[]prog.Arg) { + prog.ForeachSubArg(arg, func(arg prog.Arg, _ *prog.ArgCtx) { if !strings.HasPrefix(arg.Type().Name(), `xt_target_t["", `) { return } -- cgit mrf-deployment