Skip to contentSkip to conversation

STATE: Fix to respond error to get operation if no matching entry exists.

PATCH In review Masahide NAKAMURA 2 participants 2 messages Nov 25, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 STATE: Fix to respond error to get operation if no matching entry exists.

When application uses XFRM_MSG_GETSA to get state entry through netlink socket and kernel has no matching one, the application expects reply message with error status by kernel.

Kernel doesn't send the message back in the case of Mobile IPv6 route optimization protocols (i.e. routing header or destination options header). This is caused by incorrect return code "0" from net/xfrm/xfrm_user.c(xfrm_user_state_lookup) and it makes kernel skip to acknowledge at net/netlink/af_netlink.c(netlink_rcv_skb).

This patch fix to reply ESRCH to application.

---
 net/xfrm/xfrm_user.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/xfrm/xfrm_user.c +1 -0
index c4cde57..2ee14f8 100644
@@ -495,6 +495,7 @@ static struct xfrm_state *xfrm_user_stat
 			goto out;
 		}
 
+		err = -ESRCH;
 		x = xfrm_state_lookup_byaddr(&p->daddr, saddr, p->proto,
 					     p->family);
 	}
Signature · 1 line
1.4.2
maintainer
#1 lore raw

From: Masahide NAKAMURA <[email protected]>
Date: Sat, 25 Nov 2006 13:23:59 +0900

Quoted 10 lines

When application uses XFRM_MSG_GETSA to get state entry through netlink socket and kernel has no matching one, the application expects reply message with error status by kernel.

Kernel doesn't send the message back in the case of Mobile IPv6 route optimization protocols (i.e. routing header or destination options header). This is caused by incorrect return code "0" from net/xfrm/xfrm_user.c(xfrm_user_state_lookup) and it makes kernel skip to acknowledge at net/netlink/af_netlink.c(netlink_rcv_skb).

Quoted 4 lines

This patch fix to reply ESRCH to application.

Patch applied, thank you very much.