Sorry - I don't like it.
Can you explain why compiler alignment flags do not work.


--- Hai <[EMAIL PROTECTED]> wrote:

> Below is the patch that make addresses of particular struct members align at
> 32-bits memory boundry.
> 
> Tested on my ixp4xx system:
> [EMAIL PROTECTED]:~# uname -a
> Linux IXDP425 2.4.21-rmk1-ds1-Xteam #36 Tue Mar 11 13:20:47 CST 2008 armv5b
> unknown unknown GNU/Linux
> 
> 
> --- edge.c      (revision 3484)
> +++ edge.c      (working copy)
> @@ -747,12 +747,14 @@
>  static void readFromTAPSocket()
>  {
>    /* tun -> remote */
> -  u_char decrypted_msg[2048];
> +  u_char decrypted_msg2[2048];
> +#define ALIGN_PADDING 2
> +  u_char *decrypted_msg = decrypted_msg2 + ALIGN_PADDING;
>    size_t len;
> 
> -  len = tuntap_read(&device, decrypted_msg, sizeof(decrypted_msg));
> +  len = tuntap_read(&device, decrypted_msg, sizeof(decrypted_msg2) -
> ALIGN_PADDING);
> 
> -  if((len <= 0) || (len > sizeof(decrypted_msg)))
> +  if((len <= 0) || (len > sizeof(decrypted_msg2) - ALIGN_PADDING))
>      traceEvent(TRACE_WARNING, "read()=%d [%d/%s]\n",
>                len, errno, strerror(errno));
>    else {
> > _______________________________________________
> Ntop-dev mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop-dev
> 



      Get the name you always wanted with the new y7mail email address.
www.yahoo7.com.au/y7mail


_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to