# ipsec and awk

## Austin Wang

I have an IPSEC problem which emerged after I restarted my server after a few weeks of cumulative updates (emerge -u --deep world). When I try to start IPSEC (openswan 2.2.0) it says:

 * Starting IPSEC ... ...

awk: cmd. line:97:      default[""] = ""

awk: cmd. line:97:      ^ syntax error

awk: cmd. line:202:                     for (i in default)

awk: cmd. line:202:                               ^ syntax error

awk: cmd. line:341:     } else if (search in default)

awk: cmd. line:341:                          ^ syntax error

awk: cmd. line:345:                     default[search] = rest

awk: cmd. line:345:                     ^ syntax error

awk: cmd. line:346:             else

awk: cmd. line:346:             ^ syntax error

awk: cmd. line:407:     if (name in default)

awk: cmd. line:407:                 ^ syntax error

awk: cmd. line:409:     default[name] = value

awk: cmd. line:409:     ^ syntax error

awk: cmd. line:481:             for (name in default)

awk: cmd. line:481:                          ^ syntax error

awk: cmd. line:483:                             output(o_parm, name, default[name])

awk: cmd. line:483:                                                  ^ syntax error

awk: cmd. line:485:             if (default[search] in wanted)

awk: cmd. line:485:                 ^ syntax error

/usr/lib/ipsec/_include: line 100:  2205 Broken pipe             awk 'BEGIN {

        wasfile = ""

}

FNR == 1 {

        print ""

        print "#<", FILENAME, 1

        lineno = 0

        wasfile = FILENAME

}

{

        lineno++

        # lineno is now the number of this line

}

/^#[<>:]/ {

        next

}

/^include[ \t]+/ {

        orig = $0

        sub(/[ \t]+#.*$/, "")

        if (NF != 2) {

                msg = "(" FILENAME ", line " lineno ")"

                msg = msg " include syntax error in \"" orig "\""

                print "#:" msg

                exit 1

        }

        newfile = $2

        if (newfile !~ /^\// && FILENAME ~ /\//) {

                prefix = FILENAME

                sub("[^/]+$", "", prefix)

                newfile = prefix newfile

        }

        system("ipsec _include " newfile)

        print ""

        print "#>", FILENAME, lineno + 1

        next

}

{ print }' $*

ipsec_setup: ipsec setup: /usr/lib/ipsec/_realsetup must be called by ipsec_setup                                                                                       [ !! ]

I am running the latest up to date kernel 2.4.28 r9. I tried using an older version of the kernel (r :Cool:  but it didn't work. Upgrading to kernel 2.6 is not a possibility for me. I tried to emerge openswan again but it gives me a problem during the emerge, around the area when it compiles pluto code. Does anyone have suggestions? Perhaps I should try strongswan?

Thanks

----------

## faser

Same problem here after emerge world and reboot!

Kernel 2.6.12, but I believe that is not the problem here.

----------

## mbartsch

 *Austin Wang wrote:*   

> I have an IPSEC problem which emerged after I restarted my server after a few weeks of cumulative updates (emerge -u --deep world). When I try to start IPSEC (openswan 2.2.0) it says:
> 
>  * Starting IPSEC ... ...
> 
> awk: cmd. line:97:      default[""] = ""
> ...

 

same problem here, openswan 2.3.1 , kernel 2.6.12 , i saw in my logs than on 3 sept a new awk was emerged. 3.1.4-r4,

i emerge back the older version and ipsec is working again.

then i emerge 3.1.5 ,yes let break the system again  :Smile: , and ipsec failed again , i'm not and expert but i think this is for filling a bug, awk

newer than 3.1.2-r2 breaks IPSEC openswan.

So try to emerge the older awk until some one fix the ipsec scripts or the awk bug

emerge --oneshot "=sys-apps/gawk-3.1.3-r2"

i filled a bug 

Bug#:   	 104848  

so please post your info too.

----------

## faser

Hi Mbartsch,

thanks for posting the solution (as it was that simple I sould have figured it out myself).

emerge --oneshot "=sys-apps/gawk-3.1.3-r2"  and ipsec worked like a charme.

Cheers

Faser

----------

## neo_phani

Thanks Tired that but still no worky!

----------

## hemna

I have the same exact problem here.  the startup script bails every time due to the 'syntax' error that awk is complaining about

----------

