patches/uClibc/0.9.30.2/140-pack-netinet-structs.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Jan 15 22:21:12 2010 +0100 (2010-01-15)
changeset 1738 4baa6a9f6415
parent 1737 patches/uClibc/0.9.30.2/200-pack-netinet-structs.patch@e034c377c89d
permissions -rw-r--r--
libc/uClibc: rename patches for 0.9.30.2
     1 diff -urN uClibc-0.9.30.1.orig/include/netinet/igmp.h uClibc-0.9.30.1/include/netinet/igmp.h
     2 --- uClibc-0.9.30.1.orig/include/netinet/igmp.h	2009-04-08 09:00:10.926545132 +0200
     3 +++ uClibc-0.9.30.1/include/netinet/igmp.h	2009-04-08 09:00:26.242514273 +0200
     4 @@ -69,7 +69,7 @@
     5    u_int8_t igmp_code;             /* routing code */
     6    u_int16_t igmp_cksum;           /* checksum */
     7    struct in_addr igmp_group;      /* group address */
     8 -};
     9 +} __attribute__ ((__packed__));
    10  
    11  #define IGMP_MINLEN			8
    12  
    13 diff -urN uClibc-0.9.30.1.orig/include/netinet/in.h uClibc-0.9.30.1/include/netinet/in.h
    14 --- uClibc-0.9.30.1.orig/include/netinet/in.h	2009-04-08 09:00:10.926545132 +0200
    15 +++ uClibc-0.9.30.1/include/netinet/in.h	2009-04-08 09:00:26.242514273 +0200
    16 @@ -202,7 +202,7 @@
    17  #define s6_addr			in6_u.u6_addr8
    18  #define s6_addr16		in6_u.u6_addr16
    19  #define s6_addr32		in6_u.u6_addr32
    20 -  };
    21 +  } __attribute__ ((__packed__));
    22  
    23  extern const struct in6_addr in6addr_any;        /* :: */
    24  extern const struct in6_addr in6addr_loopback;   /* ::1 */
    25 @@ -229,7 +229,7 @@
    26  			   __SOCKADDR_COMMON_SIZE -
    27  			   sizeof (in_port_t) -
    28  			   sizeof (struct in_addr)];
    29 -  };
    30 +  } __attribute__ ((__packed__));
    31  #endif
    32  
    33  /* Ditto, for IPv6.  */
    34 @@ -240,7 +240,7 @@
    35      uint32_t sin6_flowinfo;	/* IPv6 flow information */
    36      struct in6_addr sin6_addr;	/* IPv6 address */
    37      uint32_t sin6_scope_id;	/* IPv6 scope-id */
    38 -  };
    39 +  } __attribute__ ((__packed__));
    40  
    41  
    42  /* IPv4 multicast request.  */
    43 @@ -251,7 +251,7 @@
    44  
    45      /* Local IP address of interface.  */
    46      struct in_addr imr_interface;
    47 -  };
    48 +  } __attribute__ ((__packed__));
    49  
    50  struct ip_mreq_source
    51    {
    52 @@ -263,7 +263,7 @@
    53  
    54      /* IP address of interface.  */
    55      struct in_addr imr_sourceaddr;
    56 -  };
    57 +  } __attribute__ ((__packed__));
    58  
    59  /* Likewise, for IPv6.  */
    60  struct ipv6_mreq
    61 @@ -273,7 +273,7 @@
    62  
    63      /* local interface */
    64      unsigned int ipv6mr_interface;
    65 -  };
    66 +  } __attribute__ ((__packed__));
    67  
    68  
    69  /* Multicast group request.  */
    70 @@ -284,7 +284,7 @@
    71  
    72      /* Group address.  */
    73      struct sockaddr_storage gr_group;
    74 -  };
    75 +  } __attribute__ ((__packed__));
    76  
    77  struct group_source_req
    78    {
    79 @@ -296,7 +296,7 @@
    80  
    81      /* Source address.  */
    82      struct sockaddr_storage gsr_source;
    83 -  };
    84 +  } __attribute__ ((__packed__));
    85  
    86  
    87  /* Full-state filter operations.  */
    88 @@ -315,7 +315,7 @@
    89      uint32_t imsf_numsrc;
    90      /* Source addresses.  */
    91      struct in_addr imsf_slist[1];
    92 -  };
    93 +  } __attribute__ ((__packed__));
    94  
    95  #define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
    96  				  - sizeof (struct in_addr)		      \
    97 @@ -336,7 +336,7 @@
    98      uint32_t gf_numsrc;
    99      /* Source addresses.  */
   100      struct sockaddr_storage gf_slist[1];
   101 -};
   102 +} __attribute__ ((__packed__));
   103  
   104  #define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
   105  				   - sizeof (struct sockaddr_storage)	      \
   106 @@ -460,14 +460,14 @@
   107    {
   108      struct in6_addr ipi6_addr;	/* src/dst IPv6 address */
   109      unsigned int ipi6_ifindex;	/* send/recv interface index */
   110 -  };
   111 +  } __attribute__ ((__packed__));
   112  
   113  /* IPv6 MTU information.  */
   114  struct ip6_mtuinfo
   115    {
   116      struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
   117      uint32_t ip6m_mtu;		   /* path MTU in host byte order */
   118 -  };
   119 +  } __attribute__ ((__packed__));
   120  
   121  
   122  #if 0 /*def __USE_GNU*/
   123 diff -urN uClibc-0.9.30.1.orig/include/netinet/ip.h uClibc-0.9.30.1/include/netinet/ip.h
   124 --- uClibc-0.9.30.1.orig/include/netinet/ip.h	2009-04-08 09:00:10.926545132 +0200
   125 +++ uClibc-0.9.30.1/include/netinet/ip.h	2009-04-08 09:00:26.242514273 +0200
   126 @@ -63,7 +63,7 @@
   127      u_int32_t saddr;
   128      u_int32_t daddr;
   129      /*The options start here. */
   130 -  };
   131 +  } __attribute__ ((__packed__));
   132  
   133  #ifdef __USE_BSD
   134  /*
   135 @@ -127,7 +127,7 @@
   136      u_int8_t ip_p;			/* protocol */
   137      u_short ip_sum;			/* checksum */
   138      struct in_addr ip_src, ip_dst;	/* source and dest address */
   139 -  };
   140 +  } __attribute__ ((__packed__));
   141  
   142  /*
   143   * Time stamp option structure.
   144 diff -urN uClibc-0.9.30.1.orig/include/netinet/ip_icmp.h uClibc-0.9.30.1/include/netinet/ip_icmp.h
   145 --- uClibc-0.9.30.1.orig/include/netinet/ip_icmp.h	2009-04-08 09:00:10.926545132 +0200
   146 +++ uClibc-0.9.30.1/include/netinet/ip_icmp.h	2009-04-08 09:00:26.242514273 +0200
   147 @@ -43,7 +43,7 @@
   148        u_int16_t	mtu;
   149      } frag;			/* path mtu discovery */
   150    } un;
   151 -};
   152 +} __attribute__ ((__packed__));
   153  
   154  #define ICMP_ECHOREPLY		0	/* Echo Reply			*/
   155  #define ICMP_DEST_UNREACH	3	/* Destination Unreachable	*/
   156 @@ -199,7 +199,7 @@
   157  #define	icmp_radv	icmp_dun.id_radv
   158  #define	icmp_mask	icmp_dun.id_mask
   159  #define	icmp_data	icmp_dun.id_data
   160 -};
   161 +} __attribute__ ((__packed__));
   162  
   163  /*
   164   * Lower bounds on packet lengths for various types.
   165 diff -urN uClibc-0.9.30.1.orig/include/netinet/tcp.h uClibc-0.9.30.1/include/netinet/tcp.h
   166 --- uClibc-0.9.30.1.orig/include/netinet/tcp.h	2009-04-08 09:00:10.926545132 +0200
   167 +++ uClibc-0.9.30.1/include/netinet/tcp.h	2009-04-08 09:00:26.242514273 +0200
   168 @@ -86,7 +86,7 @@
   169      u_int16_t th_win;		/* window */
   170      u_int16_t th_sum;		/* checksum */
   171      u_int16_t th_urp;		/* urgent pointer */
   172 -};
   173 +} __attribute__ ((__packed__));
   174  
   175  # else /* !__FAVOR_BSD */
   176  struct tcphdr
   177 @@ -121,7 +121,7 @@
   178      u_int16_t window;
   179      u_int16_t check;
   180      u_int16_t urg_ptr;
   181 -};
   182 +} __attribute__ ((__packed__));
   183  # endif /* __FAVOR_BSD */
   184  
   185  enum
   186 @@ -226,7 +226,7 @@
   187    u_int32_t	tcpi_rcv_space;
   188  
   189    u_int32_t	tcpi_total_retrans;
   190 -};
   191 +} __attribute__ ((__packed__));
   192  
   193  
   194  /* For TCP_MD5SIG socket option.  */
   195 @@ -239,7 +239,7 @@
   196    u_int16_t	tcpm_keylen;			/* Key length.  */
   197    u_int32_t	__tcpm_pad2;			/* Zero.  */
   198    u_int8_t	tcpm_key[TCP_MD5SIG_MAXKEYLEN];	/* Key (binary).  */
   199 -};
   200 +} __attribute__ ((__packed__));
   201  
   202  #endif /* Misc.  */
   203  
   204 diff -urN uClibc-0.9.30.1.orig/include/netinet/udp.h uClibc-0.9.30.1/include/netinet/udp.h
   205 --- uClibc-0.9.30.1.orig/include/netinet/udp.h	2009-04-08 09:00:10.926545132 +0200
   206 +++ uClibc-0.9.30.1/include/netinet/udp.h	2009-04-08 09:00:26.242514273 +0200
   207 @@ -61,7 +61,7 @@
   208    u_int16_t uh_dport;		/* destination port */
   209    u_int16_t uh_ulen;		/* udp length */
   210    u_int16_t uh_sum;		/* udp checksum */
   211 -};
   212 +} __attribute__ ((__packed__));
   213  
   214  #else
   215  
   216 @@ -71,7 +71,7 @@
   217    u_int16_t dest;
   218    u_int16_t len;
   219    u_int16_t check;
   220 -};
   221 +} __attribute__ ((__packed__));
   222  #endif
   223  
   224  #define SOL_UDP            17      /* sockopt level for UDP */