aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-10 04:30:37 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-24 21:23:59 -0400
commitc8cdaf998df221b01134a051aba38c570105061b (patch)
tree1335a3a0b377621f1c38adbdade34abd6b621c94 /net/ipv4/ip_output.c
parenta9b05723ffa2e427b0257b81ea74363fcd7c304f (diff)
[IPV4,IPV6]: Share cork.rt between IPv4 and IPv6.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 349fae58c1a3..913266cd9902 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -825,7 +825,7 @@ int ip_append_data(struct sock *sk,
825 inet->cork.fragsize = mtu = inet->pmtudisc == IP_PMTUDISC_PROBE ? 825 inet->cork.fragsize = mtu = inet->pmtudisc == IP_PMTUDISC_PROBE ?
826 rt->u.dst.dev->mtu : 826 rt->u.dst.dev->mtu :
827 dst_mtu(rt->u.dst.path); 827 dst_mtu(rt->u.dst.path);
828 inet->cork.rt = rt; 828 inet->cork.dst = &rt->u.dst;
829 inet->cork.length = 0; 829 inet->cork.length = 0;
830 sk->sk_sndmsg_page = NULL; 830 sk->sk_sndmsg_page = NULL;
831 sk->sk_sndmsg_off = 0; 831 sk->sk_sndmsg_off = 0;
@@ -834,7 +834,7 @@ int ip_append_data(struct sock *sk,
834 transhdrlen += exthdrlen; 834 transhdrlen += exthdrlen;
835 } 835 }
836 } else { 836 } else {
837 rt = inet->cork.rt; 837 rt = (struct rtable *)inet->cork.dst;
838 if (inet->cork.flags & IPCORK_OPT) 838 if (inet->cork.flags & IPCORK_OPT)
839 opt = inet->cork.opt; 839 opt = inet->cork.opt;
840 840
@@ -1083,7 +1083,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1083 if (skb_queue_empty(&sk->sk_write_queue)) 1083 if (skb_queue_empty(&sk->sk_write_queue))
1084 return -EINVAL; 1084 return -EINVAL;
1085 1085
1086 rt = inet->cork.rt; 1086 rt = (struct rtable *)inet->cork.dst;
1087 if (inet->cork.flags & IPCORK_OPT) 1087 if (inet->cork.flags & IPCORK_OPT)
1088 opt = inet->cork.opt; 1088 opt = inet->cork.opt;
1089 1089
@@ -1208,10 +1208,8 @@ static void ip_cork_release(struct inet_sock *inet)
1208 inet->cork.flags &= ~IPCORK_OPT; 1208 inet->cork.flags &= ~IPCORK_OPT;
1209 kfree(inet->cork.opt); 1209 kfree(inet->cork.opt);
1210 inet->cork.opt = NULL; 1210 inet->cork.opt = NULL;
1211 if (inet->cork.rt) { 1211 dst_release(inet->cork.dst);
1212 ip_rt_put(inet->cork.rt); 1212 inet->cork.dst = NULL;
1213 inet->cork.rt = NULL;
1214 }
1215} 1213}
1216 1214
1217/* 1215/*
@@ -1224,7 +1222,7 @@ int ip_push_pending_frames(struct sock *sk)
1224 struct sk_buff **tail_skb; 1222 struct sk_buff **tail_skb;
1225 struct inet_sock *inet = inet_sk(sk); 1223 struct inet_sock *inet = inet_sk(sk);
1226 struct ip_options *opt = NULL; 1224 struct ip_options *opt = NULL;
1227 struct rtable *rt = inet->cork.rt; 1225 struct rtable *rt = (struct rtable *)inet->cork.dst;
1228 struct iphdr *iph; 1226 struct iphdr *iph;
1229 __be16 df = 0; 1227 __be16 df = 0;
1230 __u8 ttl; 1228 __u8 ttl;