netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ipv4 ipsec
@ 2005-05-31 22:47 Edgar E Iglesias
  2005-05-31 22:56 ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Edgar E Iglesias @ 2005-05-31 22:47 UTC (permalink / raw)
  To: netdev

Hi,

Im not sure this is the correct list for ipsec issues, but shouldn't
the size check at the bottom of net/ipv4/esp4.c be the other way
around (2.6.11)?

static int __init esp4_init(void)
{
        struct xfrm_decap_state decap;

        if (sizeof(struct esp_decap_data)  <
            sizeof(decap.decap_data)) {
                extern void decap_data_too_small(void);

                decap_data_too_small();
        }

decap.decap_data should hold an opaque type for the implementation
specific decap state, so I guess it should be the bigger of the
two.

Best regards
-- 
        Programmer
        Edgar E Iglesias <edgar@axis.com> 46.46.272.1946

% diff -bu /usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c esp4.c
--- /usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c     2005-05-11 10:05:03.000000000 +0200
+++ esp4.c      2005-06-01 00:38:55.000000000 +0200
@@ -480,7 +480,7 @@
 {
        struct xfrm_decap_state decap;
 
-       if (sizeof(struct esp_decap_data)  <
+       if (sizeof(struct esp_decap_data)  >
            sizeof(decap.decap_data)) {
                extern void decap_data_too_small(void);
 

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

* Re: ipv4 ipsec
  2005-05-31 22:47 ipv4 ipsec Edgar E Iglesias
@ 2005-05-31 22:56 ` David S. Miller
  2005-05-31 23:23   ` Edgar E Iglesias
  0 siblings, 1 reply; 6+ messages in thread
From: David S. Miller @ 2005-05-31 22:56 UTC (permalink / raw)
  To: edgar.iglesias; +Cc: netdev

From: Edgar E Iglesias <edgar.iglesias@axis.com>
Date: Wed, 1 Jun 2005 00:47:17 +0200

> Im not sure this is the correct list for ipsec issues, but shouldn't
> the size check at the bottom of net/ipv4/esp4.c be the other way
> around (2.6.11)?

You are right, good catch.  Luckily the size of esp_decap_data
is exactly 20 bytes, so the incorrect test happens to be harmless.

> --- /usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c     2005-05-11 10:05:03.000000000 +0200
> +++ esp4.c      2005-06-01 00:38:55.000000000 +0200

Please porperly -p1 root your patch so I can apply it, and also
please provide a "Signed-off-by: " line for yourself as well.

It may seem pointless for a one-line patch, but I want to get you
and others into the habit of submitting patches properly in the
future.

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

* Re: ipv4 ipsec
  2005-05-31 22:56 ` David S. Miller
@ 2005-05-31 23:23   ` Edgar E Iglesias
  2005-05-31 23:47     ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Edgar E Iglesias @ 2005-05-31 23:23 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

On Tue, May 31, 2005 at 03:56:42PM -0700, David S. Miller wrote:
> From: Edgar E Iglesias <edgar.iglesias@axis.com>
> Date: Wed, 1 Jun 2005 00:47:17 +0200
> 
> > Im not sure this is the correct list for ipsec issues, but shouldn't
> > the size check at the bottom of net/ipv4/esp4.c be the other way
> > around (2.6.11)?
> 
> You are right, good catch.  Luckily the size of esp_decap_data
> is exactly 20 bytes, so the incorrect test happens to be harmless.

mostly harmless..
But for gcc ports that create packed structs per default, it is 19
bytes.

> 
> > --- /usr/src/linux-2.6.11-gentoo-r8/net/ipv4/esp4.c     2005-05-11 10:05:03.000000000 +0200
> > +++ esp4.c      2005-06-01 00:38:55.000000000 +0200
> 
> Please porperly -p1 root your patch so I can apply it, and also
> please provide a "Signed-off-by: " line for yourself as well.
> 
> It may seem pointless for a one-line patch, but I want to get you
> and others into the habit of submitting patches properly in the
> future.

oh sorry, I hope I get it right this time :)

Best regards
-- 
        Programmer
        Edgar E Iglesias <edgar@axis.com> 46.46.272.1946

Signed-off-by: Edgar E Iglesias <edgar@axis.com>

---------
% diff -Naur linux-2.6.11-gentoo-r6/net/ipv4/esp4.c  linux-2.6.11-gentoo-r9/net/ipv4/esp4.c
--- linux-2.6.11-gentoo-r6/net/ipv4/esp4.c      2005-04-14 21:39:32.000000000 +0200
+++ linux-2.6.11-gentoo-r9/net/ipv4/esp4.c      2005-06-01 00:38:55.000000000 +0200
@@ -480,7 +480,7 @@
 {
        struct xfrm_decap_state decap;
 
-       if (sizeof(struct esp_decap_data)  <
+       if (sizeof(struct esp_decap_data)  >
            sizeof(decap.decap_data)) {
                extern void decap_data_too_small(void);
 

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

* Re: ipv4 ipsec
  2005-05-31 23:23   ` Edgar E Iglesias
@ 2005-05-31 23:47     ` David S. Miller
  2005-06-01  0:02       ` Edgar E Iglesias
  0 siblings, 1 reply; 6+ messages in thread
From: David S. Miller @ 2005-05-31 23:47 UTC (permalink / raw)
  To: edgar.iglesias; +Cc: netdev

From: Edgar E Iglesias <edgar.iglesias@axis.com>
Date: Wed, 1 Jun 2005 01:23:40 +0200

> oh sorry, I hope I get it right this time :)

Your email client has mangled the tab characters into spaces
in the patch, so the patch still will not apply correctly.

Please fix this.

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

* Re: ipv4 ipsec
  2005-05-31 23:47     ` David S. Miller
@ 2005-06-01  0:02       ` Edgar E Iglesias
  2005-06-01  0:08         ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Edgar E Iglesias @ 2005-06-01  0:02 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

On Tue, May 31, 2005 at 04:47:41PM -0700, David S. Miller wrote:
> From: Edgar E Iglesias <edgar.iglesias@axis.com>
> Date: Wed, 1 Jun 2005 01:23:40 +0200
> 
> > oh sorry, I hope I get it right this time :)
> 
> Your email client has mangled the tab characters into spaces
> in the patch, so the patch still will not apply correctly.
> 
> Please fix this.

One more try.. sorry

Best regards
-- 
        Programmer
        Edgar E Iglesias <edgar@axis.com> 46.46.272.1946

Signed-off-by: Edgar E Iglesias <edgar@axis.com>

-----

--- linux-2.6.11-gentoo-r6/net/ipv4/esp4.c	2005-04-14 21:39:32.000000000 +0200
+++ linux-2.6.11-gentoo-r9/net/ipv4/esp4.c	2005-06-01 00:38:55.000000000 +0200
@@ -480,7 +480,7 @@
 {
 	struct xfrm_decap_state decap;
 
-	if (sizeof(struct esp_decap_data)  <
+	if (sizeof(struct esp_decap_data)  >
 	    sizeof(decap.decap_data)) {
 		extern void decap_data_too_small(void);
 

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

* Re: ipv4 ipsec
  2005-06-01  0:02       ` Edgar E Iglesias
@ 2005-06-01  0:08         ` David S. Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David S. Miller @ 2005-06-01  0:08 UTC (permalink / raw)
  To: edgar.iglesias; +Cc: netdev

From: Edgar E Iglesias <edgar.iglesias@axis.com>
Date: Wed, 1 Jun 2005 02:02:59 +0200

> --- linux-2.6.11-gentoo-r6/net/ipv4/esp4.c	2005-04-14 21:39:32.000000000 +0200
> +++ linux-2.6.11-gentoo-r9/net/ipv4/esp4.c	2005-06-01 00:38:55.000000000 +0200

Patch applied, thank you.

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

end of thread, other threads:[~2005-06-01  0:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-31 22:47 ipv4 ipsec Edgar E Iglesias
2005-05-31 22:56 ` David S. Miller
2005-05-31 23:23   ` Edgar E Iglesias
2005-05-31 23:47     ` David S. Miller
2005-06-01  0:02       ` Edgar E Iglesias
2005-06-01  0:08         ` David S. Miller

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).