~ubuntu-branches/ubuntu/hardy/openswan/hardy-updates

« back to all changes in this revision

Viewing changes to programs/pluto/endian.h

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2005-01-27 16:10:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050127161011-idgybmyz3vwhpfiq
Tags: 2.3.0-2
Urgency HIGH due to security issue and problems with build-deps in sarge.
* Fix the security issue. Please see
  http://www.idefense.com/application/poi/display?id=190&
      type=vulnerabilities&flashstatus=false
  for more details. Thanks to Martin Schulze for informing me about
  this issue.
  Closes: #292458: Openswan XAUTH/PAM Buffer Overflow Vulnerability
* Added a Build-Dependency to lynx.
  Closes: #291143: openswan: FTBFS: Missing build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* byte-order stuff
2
 
 * Copyright (C) 1998, 1999  D. Hugh Redelmeier.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify it
5
 
 * under the terms of the GNU General Public License as published by the
6
 
 * Free Software Foundation; either version 2 of the License, or (at your
7
 
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful, but
10
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11
 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
 
 * for more details.
13
 
 *
14
 
 * RCSID $Id: endian.h,v 1.6 2002/04/24 07:35:49 mcr Exp $
15
 
 */
16
 
 
17
 
/* sets BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN */
18
 
 
19
 
#if defined(__OpenBSD__) || defined(__NetBSD__)
20
 
# include <machine/endian.h>
21
 
#elif linux
22
 
# if defined(i386) && !defined(__i386__)
23
 
#  define __i386__ 1
24
 
#  define MYHACKFORTHIS 1
25
 
# endif
26
 
# include <endian.h>
27
 
# if 0   /* kernel's <asm/byteorder.h> clashes with glibc's <netinet/in.h> */
28
 
   /* The problem (in RedHat 5.0) is the typing of the "longs" (32-bit values)
29
 
    * in the [nh]to[hn]l functions:
30
 
    * - <asm/byteorder.h> uses unsigned long
31
 
    * - <netinet/in.h> uses u_int32_t which is unsigned int
32
 
    * Since 64-bit machines are supported, <asm/byteorder.h> should be changed.
33
 
    * For now, we simply don't use <asm/byteorder.h>.
34
 
    */
35
 
#  include <asm/byteorder.h>
36
 
# endif
37
 
# ifdef MYHACKFORTHIS
38
 
#  undef __i386__
39
 
#  undef MYHACKFORTHIS
40
 
# endif
41
 
#elif !(defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN) && defined(BYTE_ORDER))
42
 
 /* we don't know how to do this, so we require the macros to be defined
43
 
  * with compiler flags:
44
 
  *    -DBIG_ENDIAN=4321 -DLITTLE_ENDIAN=1234 -DBYTE_ORDER=BIG_ENDIAN
45
 
  * or -DBIG_ENDIAN=4321 -DLITTLE_ENDIAN=1234 -DBYTE_ORDER=LITTLE_ENDIAN
46
 
  * Thse match the GNU definitions
47
 
  */
48
 
# include <sys/endian.h>
49
 
#endif
50
 
 
51
 
#ifndef BIG_ENDIAN
52
 
 #error BIG_ENDIAN must be defined
53
 
#endif
54
 
 
55
 
#ifndef LITTLE_ENDIAN
56
 
 #error LITTLE_ENDIAN must be defined
57
 
#endif
58
 
 
59
 
#ifndef BYTE_ORDER
60
 
 #error BYTE_ORDER must be defined
61
 
#endif