diff options
author | Micah Dowty <micah@navi.cx> | 2008-07-21 12:59:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-21 13:10:56 -0400 |
commit | ae6134bdf3197206fba95563d755d2fa50d90ddd (patch) | |
tree | 0d161e5c7fdcef4a3b924be0a6fd1eaec2a81b50 /drivers/net/hamradio/hdlcdrv.c | |
parent | d3678b463df73f5060d7420915080e19baeb379b (diff) |
hdlcdrv: Fix CRC calculation.
This is a trivial patch against the hdlcdrv module that fixes its CRC
calculation. The finished CRC was overwriting the first two bytes of
each packet rather than being appended to the end.
I've tested this with 2.6.8 and 2.6.10-rc1, but hdlcdrv hasn't changed
much recently so it should work with many other kernel versions.
Signed-off-by: Micah Dowty <micah@navi.cx>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hamradio/hdlcdrv.c')
-rw-r--r-- | drivers/net/hamradio/hdlcdrv.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index ae9629fa6882..c258a0586e61 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -88,6 +88,7 @@ | |||
88 | static inline void append_crc_ccitt(unsigned char *buffer, int len) | 88 | static inline void append_crc_ccitt(unsigned char *buffer, int len) |
89 | { | 89 | { |
90 | unsigned int crc = crc_ccitt(0xffff, buffer, len) ^ 0xffff; | 90 | unsigned int crc = crc_ccitt(0xffff, buffer, len) ^ 0xffff; |
91 | buffer += len; | ||
91 | *buffer++ = crc; | 92 | *buffer++ = crc; |
92 | *buffer++ = crc >> 8; | 93 | *buffer++ = crc >> 8; |
93 | } | 94 | } |