Skip to content

Commit 3ffe533

Browse files
Alexey Dobriyandavem330
authored andcommitted
ipv6: drop unused "dev" arg of icmpv6_send()
Dunno, what was the idea, it wasn't used for a long time. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bbef49d commit 3ffe533

18 files changed

Lines changed: 33 additions & 39 deletions

File tree

‎drivers/infiniband/ulp/ipoib/ipoib_cm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ static void ipoib_cm_skb_reap(struct work_struct *work)
13741374
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
13751375
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
13761376
else if (skb->protocol == htons(ETH_P_IPV6))
1377-
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, priv->dev);
1377+
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
13781378
#endif
13791379
dev_kfree_skb_any(skb);
13801380

‎include/linux/icmpv6.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ struct icmp6_filter {
174174

175175
extern void icmpv6_send(struct sk_buff *skb,
176176
u8 type, u8 code,
177-
__u32 info,
178-
struct net_device *dev);
177+
__u32 info);
179178

180179
extern int icmpv6_init(void);
181180
extern int icmpv6_err_convert(u8 type, u8 code,

‎net/ipv4/ip_gre.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
793793
}
794794

795795
if (mtu >= IPV6_MIN_MTU && mtu < skb->len - tunnel->hlen + gre_hlen) {
796-
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, dev);
796+
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
797797
ip_rt_put(rt);
798798
goto tx_error;
799799
}

‎net/ipv6/exthdrs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
481481
IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
482482
IPSTATS_MIB_INHDRERRORS);
483483
icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
484-
0, skb->dev);
484+
0);
485485
kfree_skb(skb);
486486
return -1;
487487
}

‎net/ipv6/icmp.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static __inline__ void icmpv6_xmit_unlock(struct sock *sk)
114114
*/
115115
void icmpv6_param_prob(struct sk_buff *skb, u8 code, int pos)
116116
{
117-
icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos, skb->dev);
117+
icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos);
118118
kfree_skb(skb);
119119
}
120120

@@ -300,8 +300,7 @@ static inline void mip6_addr_swap(struct sk_buff *skb) {}
300300
/*
301301
* Send an ICMP message in response to a packet in error
302302
*/
303-
void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
304-
struct net_device *dev)
303+
void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
305304
{
306305
struct net *net = dev_net(skb->dev);
307306
struct inet6_dev *idev = NULL;

‎net/ipv6/ip6_input.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ static int ip6_input_finish(struct sk_buff *skb)
216216
IP6_INC_STATS_BH(net, idev,
217217
IPSTATS_MIB_INUNKNOWNPROTOS);
218218
icmpv6_send(skb, ICMPV6_PARAMPROB,
219-
ICMPV6_UNK_NEXTHDR, nhoff,
220-
skb->dev);
219+
ICMPV6_UNK_NEXTHDR, nhoff);
221220
}
222221
} else
223222
IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INDELIVERS);

‎net/ipv6/ip6_output.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
267267
if (net_ratelimit())
268268
printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n");
269269
skb->dev = dst->dev;
270-
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
270+
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
271271
IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS);
272272
kfree_skb(skb);
273273
return -EMSGSIZE;
@@ -441,8 +441,7 @@ int ip6_forward(struct sk_buff *skb)
441441
if (hdr->hop_limit <= 1) {
442442
/* Force OUTPUT device used as source address */
443443
skb->dev = dst->dev;
444-
icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
445-
0, skb->dev);
444+
icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT, 0);
446445
IP6_INC_STATS_BH(net,
447446
ip6_dst_idev(dst), IPSTATS_MIB_INHDRERRORS);
448447

@@ -504,15 +503,15 @@ int ip6_forward(struct sk_buff *skb)
504503
goto error;
505504
if (addrtype & IPV6_ADDR_LINKLOCAL) {
506505
icmpv6_send(skb, ICMPV6_DEST_UNREACH,
507-
ICMPV6_NOT_NEIGHBOUR, 0, skb->dev);
506+
ICMPV6_NOT_NEIGHBOUR, 0);
508507
goto error;
509508
}
510509
}
511510

512511
if (skb->len > dst_mtu(dst)) {
513512
/* Again, force OUTPUT device used as source address */
514513
skb->dev = dst->dev;
515-
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_mtu(dst), skb->dev);
514+
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_mtu(dst));
516515
IP6_INC_STATS_BH(net,
517516
ip6_dst_idev(dst), IPSTATS_MIB_INTOOBIGERRORS);
518517
IP6_INC_STATS_BH(net,
@@ -627,7 +626,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
627626
*/
628627
if (!skb->local_df) {
629628
skb->dev = skb_dst(skb)->dev;
630-
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
629+
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
631630
IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
632631
IPSTATS_MIB_FRAGFAILS);
633632
kfree_skb(skb);

‎net/ipv6/ip6_tunnel.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
622622
if (rt && rt->rt6i_dev)
623623
skb2->dev = rt->rt6i_dev;
624624

625-
icmpv6_send(skb2, rel_type, rel_code, rel_info, skb2->dev);
625+
icmpv6_send(skb2, rel_type, rel_code, rel_info);
626626

627627
if (rt)
628628
dst_release(&rt->u.dst);
@@ -1014,7 +1014,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
10141014
tel = (struct ipv6_tlv_tnl_enc_lim *)&skb_network_header(skb)[offset];
10151015
if (tel->encap_limit == 0) {
10161016
icmpv6_send(skb, ICMPV6_PARAMPROB,
1017-
ICMPV6_HDR_FIELD, offset + 2, skb->dev);
1017+
ICMPV6_HDR_FIELD, offset + 2);
10181018
return -1;
10191019
}
10201020
encap_limit = tel->encap_limit - 1;
@@ -1033,7 +1033,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
10331033
err = ip6_tnl_xmit2(skb, dev, dsfield, &fl, encap_limit, &mtu);
10341034
if (err != 0) {
10351035
if (err == -EMSGSIZE)
1036-
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, dev);
1036+
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
10371037
return -1;
10381038
}
10391039

‎net/ipv6/mip6.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static inline void *mip6_padn(__u8 *data, __u8 padlen)
5656

5757
static inline void mip6_param_prob(struct sk_buff *skb, u8 code, int pos)
5858
{
59-
icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos, skb->dev);
59+
icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos);
6060
}
6161

6262
static int mip6_mh_len(int type)

‎net/ipv6/netfilter/ip6t_REJECT.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ send_unreach(struct net *net, struct sk_buff *skb_in, unsigned char code,
169169
if (hooknum == NF_INET_LOCAL_OUT && skb_in->dev == NULL)
170170
skb_in->dev = net->loopback_dev;
171171

172-
icmpv6_send(skb_in, ICMPV6_DEST_UNREACH, code, 0, NULL);
172+
icmpv6_send(skb_in, ICMPV6_DEST_UNREACH, code, 0);
173173
}
174174

175175
static unsigned int

0 commit comments

Comments
 (0)