From: Ingo Oeser <netdev@axxeo.de>
To: spereira@tusc.com.au
Cc: linux-kenel <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 5/6] x25: Allow 32 bit socket ioctl in 64 bit kernel
Date: Thu, 16 Feb 2006 15:18:24 +0100 [thread overview]
Message-ID: <200602161518.25157.netdev@axxeo.de> (raw)
In-Reply-To: <1140068774.4941.26.camel@spereira05.tusc.com.au>
Shaun Pereira wrote:
> removed magic number 33 as suggested by Arnaldo
But are you sure, you use the right substitute for it?
> struct x25_calluserdata {
> diff -uprN -X dontdiff linux-2.6.16-rc3-vanilla/include/net/x25.h linux-2.6.16-rc3/include/net/x25.h
> --- linux-2.6.16-rc3-vanilla/include/net/x25.h 2006-02-16 15:26:19.000000000 +1100
> +++ linux-2.6.16-rc3/include/net/x25.h 2006-02-16 15:31:50.000000000 +1100
> @@ -101,9 +101,17 @@ enum {
> #define X25_FAC_PACKET_SIZE 0x42
> #define X25_FAC_WINDOW_SIZE 0x43
>
> -#define X25_MAX_FAC_LEN 20 /* Plenty to spare */
> +#define X25_MAX_FAC_LEN 60
> #define X25_MAX_CUD_LEN 128
>
> +#define X25_FAC_CALLING_AE 0xCB
> +#define X25_FAC_CALLED_AE 0xC9
> +
> +#define X25_MARKER 0x00
> +#define X25_DTE_SERVICES 0x0F
> +#define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */
> +#define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */
Are you sure that you don't mean 0x21 (== 33) here?
> diff -uprN -X dontdiff linux-2.6.16-rc3-vanilla/net/x25/x25_facilities.c linux-2.6.16-rc3/net/x25/x25_facilities.c
> --- linux-2.6.16-rc3-vanilla/net/x25/x25_facilities.c 2006-02-16 15:26:25.000000000 +1100
> +++ linux-2.6.16-rc3/net/x25/x25_facilities.c 2006-02-16 15:31:50.000000000 +1100
> @@ -112,9 +127,30 @@ int x25_parse_facilities(struct sk_buff
> len -= 4;
> break;
> case X25_FAC_CLASS_D:
> - printk(KERN_DEBUG "X.25: unknown facility %02X, "
> - "length %d, values %02X, %02X, %02X, %02X\n",
> - p[0], p[1], p[2], p[3], p[4], p[5]);
> + switch (*p) {
> + case X25_FAC_CALLING_AE:
> + if (p[1] > X25_MAX_DTE_FACIL_LEN)
Because the magic number 33 was here before ...
> + break;
> + dte_facs->calling_len = p[2];
> + memcpy(dte_facs->calling_ae, &p[3], p[1] - 1);
> + *vc_fac_mask |= X25_MASK_CALLING_AE;
> + break;
> +
> + case X25_FAC_CALLED_AE:
> + if (p[1] > X25_MAX_DTE_FACIL_LEN)
...and here
> + break;
> + dte_facs->called_len = p[2];
> + memcpy(dte_facs->called_ae, &p[3], p[1] - 1);
> + *vc_fac_mask |= X25_MASK_CALLED_AE;
> + break;
> +
> + default:
> + printk(KERN_DEBUG "X.25: unknown facility %02X,"
> + "length %d, values %02X, %02X, %02X, %02X\n",
> + p[0], p[1], p[2], p[3], p[4], p[5]);
> + break;
> + }
> +
> len -= p[1] + 2;
> p += p[1] + 2;
> break;
Regards
Ingo Oeser
next prev parent reply other threads:[~2006-02-16 14:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-16 5:46 [PATCH 5/6] x25: Allow 32 bit socket ioctl in 64 bit kernel Shaun Pereira
2006-02-16 14:18 ` Ingo Oeser [this message]
2006-02-16 22:51 ` Shaun Pereira
-- strict thread matches above, loose matches on Subject: below --
2006-02-15 22:41 Shaun Pereira
2006-02-15 22:22 Shaun Pereira
2006-02-15 22:35 ` Arnaldo Carvalho de Melo
2006-02-16 5:40 ` Shaun Pereira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602161518.25157.netdev@axxeo.de \
--to=netdev@axxeo.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=spereira@tusc.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).