[PATCH] no message type set in af_key.c, linux-2.6.15

From: Jerome Borsboom
Date: Wed Jan 11 2006 - 15:19:06 EST


When returning a message to userspace in reply to a SADB_FLUSH or SADB_X_SPDFLUSH message, the type was not set for the returned PFKEY message. The patch below corrects this problem.

Signed-off-by: Jerome Borsboom <j.borsboom@xxxxxxxxxxxx>

--- linux-2.6.15/net/key/af_key.c 2006-01-03 09:50:44.000000000 +0100
+++ linux-2.6.15/net/key/af_key.c.new 2006-01-11 17:04:02.000000000 +0100
@@ -1526,6 +1526,7 @@
if (!skb)
return -ENOBUFS;
hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg));
+ hdr->sadb_msg_type = SADB_FLUSH;
hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto);
hdr->sadb_msg_seq = c->seq;
hdr->sadb_msg_pid = c->pid;
@@ -2227,6 +2228,7 @@
if (!skb_out)
return -ENOBUFS;
hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg));
+ hdr->sadb_msg_type = SADB_X_SPDFLUSH;
hdr->sadb_msg_seq = c->seq;
hdr->sadb_msg_pid = c->pid;
hdr->sadb_msg_version = PF_KEY_V2;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/