[Openswan dev] 2.6.25, satype 0 conversion to proto failed for msg_type 14

Paul Wouters paul at xelerance.com
Mon May 17 11:05:16 EDT 2010


On Mon, 17 May 2010, Yair Elharrar wrote:

>     satype 0 conversion to proto failed for msg_type 14
> 
> I think there's something wrong with the esatype/satype conversion in kernel_pfkey.c.
> Please review this patch:

Your patch does the right thing, but we had already figured it out:

commit e1b6fdff0fa18a2723a2f2aafa0ec8006d42019b
Author: Bart Trojanowski <bart at jukie.net>
Date:   Fri Apr 9 21:16:19 2010 -0400

    fix eroute_type to satype conversion for pfkey
    
    This is a rework of 9fc2e74c61aa5c861eeeee0b71d4003c47df53eb.
    
    Before these changes the type assigned to SAs would use ET_* numbers
    instead of K_SADB_SATYPE_* numbers.
    
    Added eroute_type_to_pfkey_satype() to do the conversion and report
    proper errors.
    
    Signed-off-by: Bart Trojanowski <bart at jukie.net>

Still, thanks for the patch, and if you find more, please let us know!
But you might want to keep closer track of development. You can grab
the latest git tree at http://git.openswan.org/ and you can also
subscribe to the commits at lists.openswan.org mailinglist that will
send out email for all commits done by openswan developers.

Cheers,

Paul

> diff -ur openswan-2.6.25/programs/pluto/kernel_pfkey.c openswan-2.6.25.yair/programs/pluto/kernel_pfkey.c
> --- openswan-2.6.25/programs/pluto/kernel_pfkey.c       2010-03-21 19:39:35.000000000 +0200
> +++ openswan-2.6.25.yair/programs/pluto/kernel_pfkey.c  2010-05-17 07:22:00.856954727 +0300
> @@ -1284,6 +1290,30 @@
>      }
>  }
> 
> +enum eroute_type satype2esatype(unsigned int satype)
> +{
> +       switch(satype)
> +       {
> +       case K_SADB_SATYPE_UNSPEC:
> +               return ET_UNSPEC;
> +       case K_SADB_SATYPE_AH:
> +               return ET_AH;
> +       case K_SADB_SATYPE_ESP:
> +               return ET_ESP;
> +       case K_SADB_X_SATYPE_COMP:
> +               return ET_IPCOMP;
> +       case K_SADB_X_SATYPE_INT:
> +               return ET_INT;
> +       case K_SADB_X_SATYPE_IPIP:
> +               return ET_IPIP;
> +       default:
> +               loglog(RC_LOG_SERIOUS, "bad satype2esatype satype=%d"
> +                   , satype);
> +                   break;
> +       }
> +       return 0;
> +}
> +
>  /* install or remove eroute for SA Group */
>  bool
>  pfkey_sag_eroute(struct state *st, struct spd_route *sr
> @@ -1370,7 +1401,7 @@
> 
>      return eroute_connection(sr
>                              , inner_spi, inner_proto
> -                            , inner_satype, proto_info + i
> +                            , satype2esatype(inner_satype), proto_info + i
>                              , op, opname);
>  }
> 
> 
> This email and any files transmitted with it are confidential material. They are intended solely for the use of the designated individual or entity to whom they are addressed. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, use, distribution or copying of this communication is strictly prohibited and may be unlawful.
> 
> If you have received this email in error please immediately notify the sender and delete or destroy any copy of this message
> _______________________________________________
> Dev mailing list
> Dev at openswan.org
> http://lists.openswan.org/mailman/listinfo/dev
> 


More information about the Dev mailing list