We needn't check "m" for NULL here because "off" should be within
the mbuf chain. If we ever get a buggy caller, a bogus "off" should be caught by the sanity check at the function entry. Null "m" here means a very unusual condition of a totally broken mbuf chain (wrong m_pkthdr.len or whatever), so we can just page fault later. Found by: Coverity Prevent(tm) CID: 825
This commit is contained in:
parent
3265e741f9
commit
4e6098c6a4
@ -153,7 +153,7 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
|
||||
/*
|
||||
* Secondly calculate a summary of the first mbuf excluding offset.
|
||||
*/
|
||||
while (m != NULL && off > 0) {
|
||||
while (off > 0) {
|
||||
if (m->m_len <= off)
|
||||
off -= m->m_len;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user