Zero the reserved bytes of sadb_prob in af_key.c
diff mbox series

Message ID 20030522223038.GA31759@gondor.apana.org.au
State New, archived
Headers show
Series
  • Zero the reserved bytes of sadb_prob in af_key.c
Related show

Commit Message

Herbert Xu May 22, 2003, 10:30 p.m. UTC
According to RFC2367, all reserved bytes must be set to zero.  This patch
does just that for the sadb_prop messages.

Comments

David Miller May 23, 2003, 2:07 a.m. UTC | #1
From: Herbert Xu <herbert@gondor.apana.org.au>
   Date: Fri, 23 May 2003 08:30:38 +1000

   According to RFC2367, all reserved bytes must be set to zero.  This
   patch does just that for the sadb_prop messages.

I applied your fix except that I decided to use memset().

Please use netdev@oss.sgi.com and/or linux-net@vger.kernel.org
in the future.  Most networking hackers don't read linux-kernel
and thus wouldn't be able to review your fix.

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

Index: net/key/af_key.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/key/af_key.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 af_key.c
--- net/key/af_key.c	4 May 2003 23:53:08 -0000	1.1.1.6
+++ net/key/af_key.c	22 May 2003 09:58:45 -0000
@@ -2245,6 +2245,9 @@ 
 	p->sadb_prop_len = sizeof(struct sadb_prop)/8;
 	p->sadb_prop_exttype = SADB_EXT_PROPOSAL;
 	p->sadb_prop_replay = 32;
+	p->sadb_prop_reserved[0] = 0;
+	p->sadb_prop_reserved[1] = 0;
+	p->sadb_prop_reserved[2] = 0;
 
 	for (i = 0; ; i++) {
 		struct xfrm_algo_desc *aalg = xfrm_aalg_get_byidx(i);
@@ -2276,6 +2279,9 @@ 
 	p->sadb_prop_len = sizeof(struct sadb_prop)/8;
 	p->sadb_prop_exttype = SADB_EXT_PROPOSAL;
 	p->sadb_prop_replay = 32;
+	p->sadb_prop_reserved[0] = 0;
+	p->sadb_prop_reserved[1] = 0;
+	p->sadb_prop_reserved[2] = 0;
 
 	for (i=0; ; i++) {
 		struct xfrm_algo_desc *ealg = xfrm_ealg_get_byidx(i);