diff options
Diffstat (limited to 'isisd/iso_checksum.c')
-rw-r--r-- | isisd/iso_checksum.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/isisd/iso_checksum.c b/isisd/iso_checksum.c index 294fe9942..70b6b91ed 100644 --- a/isisd/iso_checksum.c +++ b/isisd/iso_checksum.c @@ -15,10 +15,10 @@ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. - - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <zebra.h> @@ -46,14 +46,14 @@ */ int -iso_csum_verify (u_char * buffer, int len, uint16_t * csum) +iso_csum_verify (u_char * buffer, int len, uint16_t csum, int offset) { u_int16_t checksum; u_int32_t c0; u_int32_t c1; - c0 = *csum & 0xff00; - c1 = *csum & 0x00ff; + c0 = csum & 0xff00; + c1 = csum & 0x00ff; /* * If both are zero return correct @@ -67,11 +67,8 @@ iso_csum_verify (u_char * buffer, int len, uint16_t * csum) if (c0 == 0 || c1 == 0) return 1; - /* Offset of checksum from the start of the buffer */ - int offset = (u_char *) csum - buffer; - checksum = fletcher_checksum(buffer, len, offset); - if (checksum == *csum) + if (checksum == csum) return 0; return 1; } |