Skip to contentSkip to conversation

suspicious code in net/rxrpc/ar-error.c

DISCUSSION Dave Jones 2 participants 2 messages Feb 14, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

While looking through old coverity reports, I came across this..

84 if (mtu == 0) {
85 /* they didn't give us a size, estimate one */
86 if (mtu > 1500) {
87 mtu >>= 1;
88 if (mtu < 1500)
89 mtu = 1500;
90 } else {
91 mtu -= 100;
92 if (mtu < peer->hdrsize)
93 mtu = peer->hdrsize + 4;
94 }
95 }

What was intended here ? Perhaps one of those mtu comparisons should be comparing peer->mtu ?

Dave

#1 lore raw
Quoted 2 lines · Dave Jones

What was intended here ? Perhaps one of those mtu comparisons should be comparing peer->mtu ?

Good spot, thanks. Yeah, I should be loading mtu with peer->mtu immediately after the comment.

David