Date: Mon, 29 Jun 2015 19:03:20 GMT From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287736 - soc2015/roam/ng_ayiya Message-ID: <201506291903.t5TJ3Ksd067438@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: roam Date: Mon Jun 29 19:03:19 2015 New Revision: 287736 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287736 Log: Use the ayiya_offset/length functions in ng_ayiya. ObQuote: "That's the way we do it" Modified: soc2015/roam/ng_ayiya/ng_ayiya.c Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Mon Jun 29 19:03:13 2015 (r287735) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Mon Jun 29 19:03:19 2015 (r287736) @@ -661,20 +661,20 @@ m = m2; *mb = m; } - const int32_t len = m->m_len; + const size_t len = m->m_len; struct ng_ayiya_header * const hdr = (struct ng_ayiya_header *)m->m_data; - const int32_t ofs_id = sizeof(*hdr); + const size_t ofs_id = ayiya_offset_id(hdr); if (len < ofs_id) return (EINVAL); if (hdr->idlen > 4) return (EINVAL); - const int32_t ofs_sig = ofs_id + (1 << hdr->idlen); + const size_t ofs_sig = ayiya_offset_sig(hdr); if (len < ofs_sig) return (EINVAL); - const unsigned siglen = 4 * hdr->siglen; + const size_t siglen = ayiya_length_sig(hdr); u_char * const sig = ((u_char *)hdr) + ofs_sig; - const int32_t ofs_data = ofs_sig + siglen; + const size_t ofs_data = ayiya_offset_data(hdr); if (len < ofs_data) return (EINVAL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506291903.t5TJ3Ksd067438>