#46 ZLib compression enabled when I configure 'lzo' alone

devel
open
Bishop
vtun (15)
4
2007-09-30
2007-09-30
Bishop
No

A server configuration like the following should invoke and use LZO for compression:

session01 {
passwd passme;
type tun;
proto udp;
compress lzo;
up {
ifconfig "%% 10.1.1.102 pointopoint 10.1.1.103 mtu 1450";
};
}

However, it does not:

vtund -n -P 113 session01 jitterbug
vtund[7957]: VTun client ver 3.X 12/11/2006 started
vtund[7957]: Connecting to jitterbug
vtund[7957]: Session session01[jitterbug] opened
vtund[7957]: UDP connection initialized
vtund[7957]: ZLIB compression[level 2] initialized.
vtund[7957]: Blowfish-128-ECB encryption initialized
vtund[7957]: Closing connection
vtund[7957]: Session session01[jitterbug] closed
vtund[7957]: Exit

ZLib compression was used instead.

Discussion

  • Bishop
    Bishop
    2007-09-30

    Logged In: YES
    user_id=10830
    Originator: YES

    as a workaround, use a compression level explicitly:

    compress lzo:3;

     
  • Bishop
    Bishop
    2007-09-30

    Logged In: YES
    user_id=10830
    Originator: YES

    the problem stems to this code in cfg_file.y @342:

    compress:
    NUM {
    if( $1 ){
    parse_host->flags |= VTUN_ZLIB;
    parse_host->zlevel = $1;
    }

    Generating this code:

    case 57:
    #line 343 "cfg_file.y"
    {
    if( yyvsp[0].num ){
    parse_host->flags |= VTUN_ZLIB;
    parse_host->zlevel = yyvsp[0].num;
    }
    }
    break;
    }

    which clearly cannot understand lzo unless there's a compression level given.