[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 16 Nov 2008 19:49:33 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: ilpo.jarvinen@...sinki.fi
Cc: remi.denis-courmont@...ia.com, netdev@...r.kernel.org
Subject: Re: [PATCH net 1/1] Phonet: refuse to send bigger than MTU packets
From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
Date: Fri, 14 Nov 2008 12:25:40 +0200 (EET)
> On Fri, 14 Nov 2008, Rémi Denis-Courmont wrote:
>
> > Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@...ia.com>
> > ---
> > net/phonet/af_phonet.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
> > index defeb7a..7ab30f6 100644
> > --- a/net/phonet/af_phonet.c
> > +++ b/net/phonet/af_phonet.c
> > @@ -144,8 +144,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
> > struct phonethdr *ph;
> > int err;
> >
> > - if (skb->len + 2 > 0xffff) {
> > - /* Phonet length field would overflow */
> > + if (skb->len + 2 > 0xffff /* Phonet length field limit */ ||
>
> It would by much better to have a well named constant there rather than
> such crazy and messy contruct with a comment.
Sure, but it would need to be "U16_MAX" or whatever, which we don't
have currently, since this is a field overflow check rather than some
specific constant defined by the protocol.
I'm applying Rémi's patch.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists