Skip to contentSkip to conversation

raw: restore daddr_cache in raw kernel socket.

PATCH In review Naohiro Ooiwa 2 participants 2 messages Aug 1, 2008 – Aug 2, 2008

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

PATCH 1/1 raw: restore daddr_cache in raw kernel socket.

Hi all,

I created a patch of RAW socket.

This patch adds ip6_sk_dst_lookup()/ip6_dst_store() in rawv6_sendmsg(). so that RAW socket can use "daddr_cache".

When RAW socket sent the packets to same destination, it must reduce over-head.

Could you please check the following patch?

Regards,
Naohiro Ooiwa

---
 net/ipv6/raw.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
net/ipv6/raw.c +12 -2
index 396f0ea..58c5e25 100644
@@ -858,7 +858,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
 		fl.oif = np->mcast_oif;
 	security_sk_classify_flow(sk, &fl);
 
-	err = ip6_dst_lookup(sk, &dst, &fl);
+	err = ip6_sk_dst_lookup(sk, &dst, &fl);
 	if (err)
 		goto out;
 	if (final_p)
@@ -905,7 +905,17 @@ back_from_confirm:
 		release_sock(sk);
 	}
 done:
-	dst_release(dst);
+	if (dst)
+		ip6_dst_store(sk, dst,
+			      ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
+			      &np->daddr : NULL,
+#ifdef CONFIG_IPV6_SUBTREES
+			      ipv6_addr_equal(&fl.fl6_src, &np->saddr) ?
+			      &np->saddr :
+#endif
+			      NULL);
+	else
+		dst_release(dst);
 out:
 	fl6_sock_release(flowlabel);
 	return err<0?err:len;
#1 lore raw
Quoted 10 lines · Naohiro Ooiwa

I created a patch of RAW socket.

This patch adds ip6_sk_dst_lookup()/ip6_dst_store() in rawv6_sendmsg(). so that RAW socket can use "daddr_cache".

When RAW socket sent the packets to same destination, it must reduce over-head.

Could you please check the following patch?

Please fix the IPsec issue in this thread first:

http://www.mail-archive.com/[email protected]/msg07339.html

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt