netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* suspicious code in net/rxrpc/ar-error.c
@ 2014-02-14  2:28 Dave Jones
  2014-02-14 11:21 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2014-02-14  2:28 UTC (permalink / raw)
  To: netdev; +Cc: dhowells

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-14 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14  2:28 suspicious code in net/rxrpc/ar-error.c Dave Jones
2014-02-14 11:21 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).