From patchwork Wed Sep 26 00:41:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Maciej_=C5=BBenczykowski?= X-Patchwork-Id: 974775 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42KfJl4YYHz9s4s for ; Wed, 26 Sep 2018 10:41:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726499AbeIZGvv convert rfc822-to-8bit (ORCPT ); Wed, 26 Sep 2018 02:51:51 -0400 Received: from mail-it1-f201.google.com ([209.85.166.201]:35619 "EHLO mail-it1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726372AbeIZGvu (ORCPT ); Wed, 26 Sep 2018 02:51:50 -0400 Received: by mail-it1-f201.google.com with SMTP id w68-v6so903811ith.0 for ; Tue, 25 Sep 2018 17:41:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=BSDfzik3q74AQVIDRN4PtiHpsI9RdPdQSeXO97M1mpY=; b=fJe32b3rTcn+sdU13RsP3oLPtR+LgeRVtFFnvj4CBzIuVxmgxQZRVLHvDkGadhBpS5 vluc9lvrr4CJUHDUIzKLoFVi9nEC/wDj30KZ0YJ1xEJqvvCOYMRU/ydoQZsT4vVyzTHY hCHrfDtSHiQqBgS+1va6cm8KjWrhXF2iR2OaO/DyQ+GBpzK4OPfsPqyGAmOJnvWin8Pg IstWC8RSRqn1AH8XyznTX5OMaTPtDX1r00wlzRhQL/i5vQZg0zMI5VOqG3xe2PO2N/Rc IVc77wrWBnK/oFrexR05NfTSrxglqR599gk1yGCrAAhdFsTEH7/bWJPuWG9xo1R3O4Du S2bg== X-Gm-Message-State: ABuFfoj14qB44HEgLfvxvZBL19XuHcEXyQnOxlR+tlpbJt29e5DvU4fP tw0Wm2JPBAZG25bBtr4fRqSqDg== X-Google-Smtp-Source: ACcGV62S4ppHadF6+IwKi2N1MFoQ6ZDEpUZ8RUK6PGOaxeUfTmaggqa+o1c56cc4mEqlsBadA0tG9Bqe X-Received: by 2002:a6b:ce10:: with SMTP id p16-v6mr2593682iob.74.1537922501220; Tue, 25 Sep 2018 17:41:41 -0700 (PDT) Date: Tue, 25 Sep 2018 17:41:36 -0700 Message-Id: <20180926004137.163699-1-zenczykowski@gmail.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog Subject: [PATCH 1/2] net-ipv4: remove 2 always zero parameters from ipv4_update_pmtu() From: "=?UTF-8?q?Maciej=20=C5=BBenczykowski?=" To: "=?UTF-8?q?Maciej=20=C5=BBenczykowski?=" , "David S . Miller" , Eric Dumazet Cc: netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Maciej Żenczykowski Signed-off-by: Maciej Żenczykowski Reviewed-by: David Ahern --- include/net/route.h | 2 +- net/ipv4/ah4.c | 2 +- net/ipv4/esp4.c | 2 +- net/ipv4/icmp.c | 2 +- net/ipv4/ip_gre.c | 2 +- net/ipv4/ip_vti.c | 2 +- net/ipv4/ipcomp.c | 2 +- net/ipv4/ipip.c | 3 +-- net/ipv4/route.c | 8 +++----- net/ipv6/sit.c | 2 +- net/netfilter/ipvs/ip_vs_core.c | 3 +-- net/xfrm/xfrm_interface.c | 2 +- 12 files changed, 14 insertions(+), 18 deletions(-) diff --git a/include/net/route.h b/include/net/route.h index bb53cdba38dc..73c605bdd6d8 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -201,7 +201,7 @@ static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, } void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, int oif, - u32 mark, u8 protocol, int flow_flags); + u8 protocol); void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu); void ipv4_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark, u8 protocol, int flow_flags); diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 4dd95cdd8070..8811fe30282a 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -461,7 +461,7 @@ static int ah4_err(struct sk_buff *skb, u32 info) return 0; if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) - ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0); + ipv4_update_pmtu(skb, net, info, 0, IPPROTO_AH); else ipv4_redirect(skb, net, 0, 0, IPPROTO_AH, 0); xfrm_state_put(x); diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 97689012b357..2d0274441923 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -820,7 +820,7 @@ static int esp4_err(struct sk_buff *skb, u32 info) return 0; if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) - ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0); + ipv4_update_pmtu(skb, net, info, 0, IPPROTO_ESP); else ipv4_redirect(skb, net, 0, 0, IPPROTO_ESP, 0); xfrm_state_put(x); diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 695979b7ef6d..8013b37b598f 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -1098,7 +1098,7 @@ void icmp_err(struct sk_buff *skb, u32 info) } if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) - ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ICMP, 0); + ipv4_update_pmtu(skb, net, info, 0, IPPROTO_ICMP); else if (type == ICMP_REDIRECT) ipv4_redirect(skb, net, 0, 0, IPPROTO_ICMP, 0); } diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index c3385a84f8ff..83b80fafd8f2 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -239,7 +239,7 @@ static void gre_err(struct sk_buff *skb, u32 info) if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) { ipv4_update_pmtu(skb, dev_net(skb->dev), info, - skb->dev->ifindex, 0, IPPROTO_GRE, 0); + skb->dev->ifindex, IPPROTO_GRE); return; } if (type == ICMP_REDIRECT) { diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index f38cb21d773d..1b5571cb3282 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c @@ -318,7 +318,7 @@ static int vti4_err(struct sk_buff *skb, u32 info) return 0; if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) - ipv4_update_pmtu(skb, net, info, 0, 0, protocol, 0); + ipv4_update_pmtu(skb, net, info, 0, protocol); else ipv4_redirect(skb, net, 0, 0, protocol, 0); xfrm_state_put(x); diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index d97f4f2787f5..04049d1330a2 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c @@ -48,7 +48,7 @@ static int ipcomp4_err(struct sk_buff *skb, u32 info) return 0; if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) - ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0); + ipv4_update_pmtu(skb, net, info, 0, IPPROTO_COMP); else ipv4_redirect(skb, net, 0, 0, IPPROTO_COMP, 0); xfrm_state_put(x); diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index c891235b4966..6ff008e5818d 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -175,8 +175,7 @@ static int ipip_err(struct sk_buff *skb, u32 info) } if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) { - ipv4_update_pmtu(skb, net, info, t->parms.link, 0, - iph->protocol, 0); + ipv4_update_pmtu(skb, net, info, t->parms.link, iph->protocol); goto out; } diff --git a/net/ipv4/route.c b/net/ipv4/route.c index b678466da451..7bbe3fc80b90 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1040,17 +1040,15 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, } void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, - int oif, u32 mark, u8 protocol, int flow_flags) + int oif, u8 protocol) { const struct iphdr *iph = (const struct iphdr *) skb->data; struct flowi4 fl4; struct rtable *rt; - - if (!mark) - mark = IP4_REPLY_MARK(net, skb->mark); + u32 mark = IP4_REPLY_MARK(net, skb->mark); __build_flow_key(net, &fl4, NULL, iph, oif, - RT_TOS(iph->tos), protocol, mark, flow_flags); + RT_TOS(iph->tos), protocol, mark, 0); rt = __ip_route_output_key(net, &fl4); if (!IS_ERR(rt)) { __ip_rt_update_pmtu(rt, &fl4, mtu); diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index e9400ffa7875..085c588ebfe0 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -534,7 +534,7 @@ static int ipip6_err(struct sk_buff *skb, u32 info) if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) { ipv4_update_pmtu(skb, dev_net(skb->dev), info, - t->parms.link, 0, iph->protocol, 0); + t->parms.link, iph->protocol); err = 0; goto out; } diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 7ca926a03b81..fe9abf3cc10a 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c @@ -1686,8 +1686,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related, skb_reset_network_header(skb); IP_VS_DBG(12, "ICMP for IPIP %pI4->%pI4: mtu=%u\n", &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, mtu); - ipv4_update_pmtu(skb, ipvs->net, - mtu, 0, 0, 0, 0); + ipv4_update_pmtu(skb, ipvs->net, mtu, 0, 0); /* Client uses PMTUD? */ if (!(frag_off & htons(IP_DF))) goto ignore_ipip; diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c index 31acc6f33d98..16bc5ecb7869 100644 --- a/net/xfrm/xfrm_interface.c +++ b/net/xfrm/xfrm_interface.c @@ -469,7 +469,7 @@ static int xfrmi4_err(struct sk_buff *skb, u32 info) } if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) - ipv4_update_pmtu(skb, net, info, 0, 0, protocol, 0); + ipv4_update_pmtu(skb, net, info, 0, protocol); else ipv4_redirect(skb, net, 0, 0, protocol, 0); xfrm_state_put(x);