[Openswan dev] [xl2tpd] [PATCH] work around endianness bug in Apple's L2TP

Paul Wouters paul at xelerance.com
Tue Feb 22 11:45:07 EST 2011

On Tue, 22 Feb 2011, Brian Mastenbrook wrote:

> The codes in question should have been 3 and 1, respectively. The problem 
> lies in Apple's L2TP implementation:
>    *((u_int16_t*)buf) = params->result_code;
> and
>            *((u_int16_t*)buf) = params->error_code;
> from prepare_StopCCN and prepare_CDN in 
> http://www.opensource.apple.com/source/ppp/ppp-412.3/Drivers/L2TP/L2TP-plugin/l2tp.c 
> . Note the missing "htons". Bad Apple!
> The attached patch works around the problem by treating any result code or 
> error code whose low byte is 0 and high byte is a plausible result/error code 
> as an indication of this bug. With the patch in place, tunnels are cleaned up 
> immediately when the client disconnects.

Thanks! Will be in xl2tpd 1.2.8


More information about the Dev mailing list