Skip to content

Commit b5c15fc

Browse files
herbertxdavem330
authored andcommitted
[IPV6]: Fix reversed local_df test in ip6_fragment
I managed to reverse the local_df test when forward-porting this patch so it actually makes things worse by never fragmenting at all. Thanks to David Stevens for testing and reporting this bug. Bill Fink pointed out that the local_df setting is also the wrong way around. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 073a371 commit b5c15fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/ipv6/ip6_output.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
621621
* or if the skb it not generated by a local socket. (This last
622622
* check should be redundant, but it's free.)
623623
*/
624-
if (skb->local_df) {
624+
if (!skb->local_df) {
625625
skb->dev = skb->dst->dev;
626626
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
627627
IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_FRAGFAILS);
@@ -1421,7 +1421,7 @@ int ip6_push_pending_frames(struct sock *sk)
14211421
}
14221422

14231423
/* Allow local fragmentation. */
1424-
if (np->pmtudisc >= IPV6_PMTUDISC_DO)
1424+
if (np->pmtudisc < IPV6_PMTUDISC_DO)
14251425
skb->local_df = 1;
14261426

14271427
ipv6_addr_copy(final_dst, &fl->fl6_dst);

0 commit comments

Comments
 (0)