2006-01-11 20:20:20

by Jerome Borsboom

[permalink] [raw]
Subject: [PATCH] no message type set in af_key.c, linux-2.6.15

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 <[email protected]>

--- 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;


2006-01-24 20:59:48

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] no message type set in af_key.c, linux-2.6.15

From: Jerome Borsboom <[email protected]>
Date: Wed, 11 Jan 2006 21:20:06 +0100 (CET)

> 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 <[email protected]>

Applied, thanks Jerome.