* 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
* Re: suspicious code in net/rxrpc/ar-error.c
2014-02-14 2:28 suspicious code in net/rxrpc/ar-error.c Dave Jones
@ 2014-02-14 11:21 ` David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2014-02-14 11:21 UTC (permalink / raw)
To: Dave Jones; +Cc: dhowells, netdev
Dave Jones <davej@redhat.com> wrote:
> 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
^ 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.