diff options
author | YOSHIFUJI Hideaki <yosufuji@linux-ipv6.org> | 2006-02-24 16:18:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-02-24 16:18:33 -0500 |
commit | d91675f9c7f5752e8657df1e1d926bd6a624434f (patch) | |
tree | c0285999dc00ca9c8af84606ee98224c67c71e96 /net/ipv6/ip6_output.c | |
parent | 0c0888908dec145aaaa40d8a49d34913573f5a27 (diff) |
[IPV6]: Do not ignore IPV6_MTU socket option.
Based on patch by Hoerdt Mickael <hoerdt@clarinet.u-strasbg.fr>.
Signed-off-by: YOSHIFUJI Hideaki <yosufuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index efa3e72cfcfa..f999edd846a9 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -494,6 +494,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
494 | struct net_device *dev; | 494 | struct net_device *dev; |
495 | struct sk_buff *frag; | 495 | struct sk_buff *frag; |
496 | struct rt6_info *rt = (struct rt6_info*)skb->dst; | 496 | struct rt6_info *rt = (struct rt6_info*)skb->dst; |
497 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | ||
497 | struct ipv6hdr *tmp_hdr; | 498 | struct ipv6hdr *tmp_hdr; |
498 | struct frag_hdr *fh; | 499 | struct frag_hdr *fh; |
499 | unsigned int mtu, hlen, left, len; | 500 | unsigned int mtu, hlen, left, len; |
@@ -505,7 +506,12 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
505 | hlen = ip6_find_1stfragopt(skb, &prevhdr); | 506 | hlen = ip6_find_1stfragopt(skb, &prevhdr); |
506 | nexthdr = *prevhdr; | 507 | nexthdr = *prevhdr; |
507 | 508 | ||
508 | mtu = dst_mtu(&rt->u.dst) - hlen - sizeof(struct frag_hdr); | 509 | mtu = dst_mtu(&rt->u.dst); |
510 | if (np && np->frag_size < mtu) { | ||
511 | if (np->frag_size) | ||
512 | mtu = np->frag_size; | ||
513 | } | ||
514 | mtu -= hlen + sizeof(struct frag_hdr); | ||
509 | 515 | ||
510 | if (skb_shinfo(skb)->frag_list) { | 516 | if (skb_shinfo(skb)->frag_list) { |
511 | int first_len = skb_pagelen(skb); | 517 | int first_len = skb_pagelen(skb); |
@@ -882,7 +888,12 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, | |||
882 | inet->cork.fl = *fl; | 888 | inet->cork.fl = *fl; |
883 | np->cork.hop_limit = hlimit; | 889 | np->cork.hop_limit = hlimit; |
884 | np->cork.tclass = tclass; | 890 | np->cork.tclass = tclass; |
885 | inet->cork.fragsize = mtu = dst_mtu(rt->u.dst.path); | 891 | mtu = dst_mtu(rt->u.dst.path); |
892 | if (np && np->frag_size < mtu) { | ||
893 | if (np->frag_size) | ||
894 | mtu = np->frag_size; | ||
895 | } | ||
896 | inet->cork.fragsize = mtu; | ||
886 | if (dst_allfrag(rt->u.dst.path)) | 897 | if (dst_allfrag(rt->u.dst.path)) |
887 | inet->cork.flags |= IPCORK_ALLFRAG; | 898 | inet->cork.flags |= IPCORK_ALLFRAG; |
888 | inet->cork.length = 0; | 899 | inet->cork.length = 0; |