* [PATCH] raw: restore daddr_cache in raw kernel socket.
@ 2008-08-01 10:00 Naohiro Ooiwa
2008-08-02 0:52 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Naohiro Ooiwa @ 2008-08-01 10:00 UTC (permalink / raw)
To: usagi-users, netdev; +Cc: YOSHIFUJI Hideaki / 吉藤英明
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
Signed-off-by: Naohiro Ooiwa <nooiwa@miraclelinux.com>
---
net/ipv6/raw.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 396f0ea..58c5e25 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -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;
--
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] raw: restore daddr_cache in raw kernel socket.
2008-08-01 10:00 [PATCH] raw: restore daddr_cache in raw kernel socket Naohiro Ooiwa
@ 2008-08-02 0:52 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2008-08-02 0:52 UTC (permalink / raw)
To: Naohiro Ooiwa; +Cc: usagi-users, netdev, yoshfuji
Naohiro Ooiwa <nooiwa@miraclelinux.com> wrote:
>
> 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/netdev@vger.kernel.org/msg07339.html
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-02 0:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-01 10:00 [PATCH] raw: restore daddr_cache in raw kernel socket Naohiro Ooiwa
2008-08-02 0:52 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).