freebsd-skq/sys/netgraph
John Polstra a514569e9a Fix a range checking bug in ng_int32_parse which affected 64-bit
machines.  The code formerly read:

    long val;
    if (val < (long)-0x80000000 || ...)
            return EINVAL;

The constant 0x80000000 has type unsigned int.  The unary `-'
operator does not change the type (or the value, in this case).
Therefore the promotion to long is done by 0-extension, giving
0x0000000080000000 instead of the desired 0xffffffff80000000.  I
got rid of the `-' and changed the cast to (int32_t) to give proper
sign-extension on all architectures and to better reflect the fact
that we are range-checking a 32-bit value.

This commit also makes the analogous changes to ng_int{8,16}_parse
for consistency.

MFC after:	3 days
2001-05-19 19:36:32 +00:00
..
netgraph.h
ng_async.c
ng_async.h
ng_base.c
ng_bpf.c
ng_bpf.h
ng_bridge.c
ng_bridge.h
ng_cisco.c
ng_cisco.h
ng_echo.c
ng_echo.h
ng_eiface.c
ng_eiface.h
ng_ether.c
ng_ether.h
ng_frame_relay.c
ng_frame_relay.h
ng_hole.c
ng_hole.h
ng_iface.c
ng_iface.h
ng_ksocket.c
ng_ksocket.h
ng_lmi.c
ng_lmi.h
ng_message.h
ng_mppc.c
ng_mppc.h
ng_one2many.c
ng_one2many.h
ng_parse.c Fix a range checking bug in ng_int32_parse which affected 64-bit 2001-05-19 19:36:32 +00:00
ng_parse.h
ng_ppp.c
ng_ppp.h
ng_pppoe.c
ng_pppoe.h
ng_pptpgre.c
ng_pptpgre.h
ng_rfc1490.c
ng_rfc1490.h
ng_sample.c
ng_sample.h
ng_socket.c
ng_socket.h
ng_socketvar.h
ng_split.c
ng_split.h
ng_tee.c
ng_tee.h
ng_tty.c
ng_tty.h
ng_UI.c
ng_UI.h
ng_vjc.c
ng_vjc.h
NOTES