linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the ipsec tree with the net tree
@ 2018-03-25 22:16 Stephen Rothwell
  2018-03-27 14:33 ` Petr Machata
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2018-03-25 22:16 UTC (permalink / raw)
  To: Steffen Klassert, David Miller, Networking
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Petr Machata,
	Stefano Brivio

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

Hi Steffen,

Today's linux-next merge of the ipsec tree got a conflict in:

  net/ipv4/ip_tunnel.c

between commit:

  f6cc9c054e77 ("ip_tunnel: Emit events for post-register MTU changes")

from the net tree and commit:

  24fc79798b8d ("ip_tunnel: Clamp MTU to bounds on new link")

from the ipsec tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv4/ip_tunnel.c
index 7b85ffad5d74,7c76dd17b6b9..000000000000
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@@ -1117,10 -1108,13 +1117,15 @@@ int ip_tunnel_newlink(struct net_devic
  		eth_hw_addr_random(dev);
  
  	mtu = ip_tunnel_bind_dev(dev);
- 	if (!tb[IFLA_MTU]) {
+ 	if (tb[IFLA_MTU]) {
+ 		unsigned int max = 0xfff8 - dev->hard_header_len - nt->hlen;
+ 
+ 		dev->mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
+ 				 (unsigned int)(max - sizeof(struct iphdr)));
+ 	} else {
 -		dev->mtu = mtu;
 +		err = dev_set_mtu(dev, mtu);
 +		if (err)
 +			goto err_dev_set_mtu;
  	}
  
  	ip_tunnel_add(itn, nt);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the ipsec tree with the net tree
  2018-03-25 22:16 linux-next: manual merge of the ipsec tree with the net tree Stephen Rothwell
@ 2018-03-27 14:33 ` Petr Machata
  2018-03-27 17:23   ` Stefano Brivio
  2018-03-27 17:41   ` Stephen Rothwell
  0 siblings, 2 replies; 5+ messages in thread
From: Petr Machata @ 2018-03-27 14:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Steffen Klassert, David Miller, Networking,
	Linux-Next Mailing List, Linux Kernel Mailing List,
	Stefano Brivio

Stephen Rothwell <sfr@canb.auug.org.au> writes:

> Hi Steffen,
>
> Today's linux-next merge of the ipsec tree got a conflict in:
>
>   net/ipv4/ip_tunnel.c
>
> between commit:
>
>   f6cc9c054e77 ("ip_tunnel: Emit events for post-register MTU changes")
>
> from the net tree and commit:
>
>   24fc79798b8d ("ip_tunnel: Clamp MTU to bounds on new link")
>
> from the ipsec tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Hi, this conflict needs to be resolved differently. Below I'm adding a
patch on top of linux-next. Squash or apply as you see fit.

What's the right way to proceed from here? It looks to me like Stefano
or Steffen should take this into the ipsec tree (possibly just squash to
the clamping fix), as they'll hit this conflict the next time they
rebase on top of net...? Let me know what to do, please.

Thanks,
Petr

>From 2c2210e59cd94571ac67d491026d6ea0f4d69ae4 Mon Sep 17 00:00:00 2001
Message-Id: <2c2210e59cd94571ac67d491026d6ea0f4d69ae4.1522155963.git.petrm@mellanox.com>
From: Petr Machata <petrm@mellanox.com>
Date: Tue, 27 Mar 2018 16:00:38 +0300
Subject: [PATCH linux-next] net: ip_tunnel: Call dev_set_mtu to set
 clamped MTU

When adding a new IP tunnel link, MTU is clamped to sane bounds.
However, since the new MTU value is directly assigned to the netdevice,
instead of going through dev_set_mtu, the change is done without sending
the usual NETDEV_PRECHANGEMTU and NETDEV_CHANGEMTU events. Thus drivers
don't get to learn about the clamped MTU value.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 net/ipv4/ip_tunnel.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index a57cf0d..de6d944 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -1108,14 +1108,14 @@ int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
 	if (tb[IFLA_MTU]) {
 		unsigned int max = 0xfff8 - dev->hard_header_len - nt->hlen;
 
-		dev->mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
-				 (unsigned int)(max - sizeof(struct iphdr)));
-	} else {
-		err = dev_set_mtu(dev, mtu);
-		if (err)
-			goto err_dev_set_mtu;
+		mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
+			    (unsigned int)(max - sizeof(struct iphdr)));
 	}
 
+	err = dev_set_mtu(dev, mtu);
+	if (err)
+		goto err_dev_set_mtu;
+
 	ip_tunnel_add(itn, nt);
 	return 0;
 
-- 
2.4.11

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the ipsec tree with the net tree
  2018-03-27 14:33 ` Petr Machata
@ 2018-03-27 17:23   ` Stefano Brivio
  2018-03-27 17:41   ` Stephen Rothwell
  1 sibling, 0 replies; 5+ messages in thread
From: Stefano Brivio @ 2018-03-27 17:23 UTC (permalink / raw)
  To: Petr Machata, Stephen Rothwell, Steffen Klassert
  Cc: David Miller, Networking, Linux-Next Mailing List,
	Linux Kernel Mailing List

On Tue, 27 Mar 2018 17:33:43 +0300
Petr Machata <petrm@mellanox.com> wrote:

> Hi, this conflict needs to be resolved differently. Below I'm adding a
> patch on top of linux-next. Squash or apply as you see fit.

Petr, thanks for spotting this. Stephen, you can carry these tags for
Petr's patch:

Fixes: adab890d00dc ("Merge remote-tracking branch 'ipsec/master'")
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>

> What's the right way to proceed from here? It looks to me like Stefano
> or Steffen should take this into the ipsec tree (possibly just squash to
> the clamping fix), as they'll hit this conflict the next time they
> rebase on top of net...? Let me know what to do, please.

Steffen, please let me know if you want me to submit anything for the
ipsec tree on top of my previous patches.

I guess another alternative would be that David fixes the conflict the
way Petr solved it, when merging to net?

-- 
Stefano

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the ipsec tree with the net tree
  2018-03-27 14:33 ` Petr Machata
  2018-03-27 17:23   ` Stefano Brivio
@ 2018-03-27 17:41   ` Stephen Rothwell
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2018-03-27 17:41 UTC (permalink / raw)
  To: Petr Machata
  Cc: Steffen Klassert, David Miller, Networking,
	Linux-Next Mailing List, Linux Kernel Mailing List,
	Stefano Brivio

[-- Attachment #1: Type: text/plain, Size: 727 bytes --]

Hi Petr,

On Tue, 27 Mar 2018 17:33:43 +0300 Petr Machata <petrm@mellanox.com> wrote:
>
> Hi, this conflict needs to be resolved differently. Below I'm adding a
> patch on top of linux-next. Squash or apply as you see fit.
> 
> What's the right way to proceed from here? It looks to me like Stefano
> or Steffen should take this into the ipsec tree (possibly just squash to
> the clamping fix), as they'll hit this conflict the next time they
> rebase on top of net...? Let me know what to do, please.

I fixed up the resolution in linux-next to match your patch from
today.  Dave will need to do this when he merges the ipsec tree into
the net tree before sending it to Linus.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the ipsec tree with the net tree
@ 2021-03-03 22:18 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2021-03-03 22:18 UTC (permalink / raw)
  To: Steffen Klassert, David Miller, Networking
  Cc: Eyal Birger, Jason A. Donenfeld, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]

Hi all,

Today's linux-next merge of the ipsec tree got conflicts in:

  net/ipv4/ip_vti.c
  net/ipv6/ip6_vti.c

between commit:

  4372339efc06 ("net: always use icmp{,v6}_ndo_send from ndo_start_xmit")

from the net tree and commits:

  c7c1abfd6d42 ("vti: fix ipv4 pmtu check to honor ip header df")
  4c38255892c0 ("vti6: fix ipv4 pmtu check to honor ip header df")

from the ipsec tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv4/ip_vti.c
index eb207089ece0,613741384490..000000000000
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@@ -238,8 -238,10 +238,10 @@@ static netdev_tx_t vti_xmit(struct sk_b
  	if (skb->len > mtu) {
  		skb_dst_update_pmtu_no_confirm(skb, mtu);
  		if (skb->protocol == htons(ETH_P_IP)) {
+ 			if (!(ip_hdr(skb)->frag_off & htons(IP_DF)))
+ 				goto xmit;
 -			icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
 -				  htonl(mtu));
 +			icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
 +				      htonl(mtu));
  		} else {
  			if (mtu < IPV6_MIN_MTU)
  				mtu = IPV6_MIN_MTU;
diff --cc net/ipv6/ip6_vti.c
index f10e7a72ea62,2f0be5ac021c..000000000000
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@@ -521,10 -521,12 +521,12 @@@ vti6_xmit(struct sk_buff *skb, struct n
  			if (mtu < IPV6_MIN_MTU)
  				mtu = IPV6_MIN_MTU;
  
 -			icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
 +			icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
  		} else {
+ 			if (!(ip_hdr(skb)->frag_off & htons(IP_DF)))
+ 				goto xmit;
 -			icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
 -				  htonl(mtu));
 +			icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
 +				      htonl(mtu));
  		}
  
  		err = -EMSGSIZE;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-04  0:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-25 22:16 linux-next: manual merge of the ipsec tree with the net tree Stephen Rothwell
2018-03-27 14:33 ` Petr Machata
2018-03-27 17:23   ` Stefano Brivio
2018-03-27 17:41   ` Stephen Rothwell
2021-03-03 22:18 Stephen Rothwell

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).