[lkml]   [1998]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Re: [ipchains] logging tcp/udp port numbers
    In message <730l68$95r$>, H. Peter Anvin writes:
    | The error occurs on bigendian machines because you're effectively
    | doing the moral equivalent of:
    | foo = *(short *)(&args[n--]);
    | instead of
    | foo = (short) *(int *)(&args[n--]);
    | ... which is the same of littleendian boxen but not bigendian.

    The actual expression is more like

    __internal_argp = (void *) &args;
    foo = *((short *) __internal_argp)++;

    so while you get the correct value on little-endian, the next value will be
    taken from the wrong address.

    brandon s. allbery [os/2][linux][solaris][japh]
    system administrator [WAY too many hats]
    carnegie mellon / electrical and computer engineering KF8NH
    Kiss my bits, Billy-boy.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:45    [W:0.018 / U:4.720 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site