Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 673d57e7 authored by Harvey Harrison's avatar Harvey Harrison Committed by David S. Miller
Browse files

net: replace NIPQUAD() in net/ipv4/ net/ipv6/



Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u
can be replaced with %pI4

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cffee385
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -1070,11 +1070,8 @@ static int inet_sk_reselect_saddr(struct sock *sk)
		return 0;
		return 0;


	if (sysctl_ip_dynaddr > 1) {
	if (sysctl_ip_dynaddr > 1) {
		printk(KERN_INFO "%s(): shifting inet->"
		printk(KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n",
				 "saddr from " NIPQUAD_FMT " to " NIPQUAD_FMT "\n",
		       __func__, &old_saddr, &new_saddr);
		       __func__,
		       NIPQUAD(old_saddr),
		       NIPQUAD(new_saddr));
	}
	}


	inet->saddr = inet->rcv_saddr = new_saddr;
	inet->saddr = inet->rcv_saddr = new_saddr;
+2 −2
Original line number Original line Diff line number Diff line
@@ -1308,7 +1308,7 @@ static void arp_format_neigh_entry(struct seq_file *seq,
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
	}
	}
#endif
#endif
	sprintf(tbuf, NIPQUAD_FMT, NIPQUAD(*(u32*)n->primary_key));
	sprintf(tbuf, "%pI4", n->primary_key);
	seq_printf(seq, "%-16s 0x%-10x0x%-10x%s     *        %s\n",
	seq_printf(seq, "%-16s 0x%-10x0x%-10x%s     *        %s\n",
		   tbuf, hatype, arp_state_to_flags(n), hbuffer, dev->name);
		   tbuf, hatype, arp_state_to_flags(n), hbuffer, dev->name);
	read_unlock(&n->lock);
	read_unlock(&n->lock);
@@ -1321,7 +1321,7 @@ static void arp_format_pneigh_entry(struct seq_file *seq,
	int hatype = dev ? dev->type : 0;
	int hatype = dev ? dev->type : 0;
	char tbuf[16];
	char tbuf[16];


	sprintf(tbuf, NIPQUAD_FMT, NIPQUAD(*(u32*)n->key));
	sprintf(tbuf, "%pI4", n->key);
	seq_printf(seq, "%-16s 0x%-10x0x%-10x%s     *        %s\n",
	seq_printf(seq, "%-16s 0x%-10x0x%-10x%s     *        %s\n",
		   tbuf, hatype, ATF_PUBL | ATF_PERM, "00:00:00:00:00:00",
		   tbuf, hatype, ATF_PUBL | ATF_PERM, "00:00:00:00:00:00",
		   dev ? dev->name : "*");
		   dev ? dev->name : "*");
+3 −3
Original line number Original line Diff line number Diff line
@@ -2399,8 +2399,8 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
		__be32 prf = htonl(mask_pfx(tn->key, tn->pos));
		__be32 prf = htonl(mask_pfx(tn->key, tn->pos));


		seq_indent(seq, iter->depth-1);
		seq_indent(seq, iter->depth-1);
		seq_printf(seq, "  +-- " NIPQUAD_FMT "/%d %d %d %d\n",
		seq_printf(seq, "  +-- %pI4/%d %d %d %d\n",
			   NIPQUAD(prf), tn->pos, tn->bits, tn->full_children,
			   &prf, tn->pos, tn->bits, tn->full_children,
			   tn->empty_children);
			   tn->empty_children);


	} else {
	} else {
@@ -2410,7 +2410,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
		__be32 val = htonl(l->key);
		__be32 val = htonl(l->key);


		seq_indent(seq, iter->depth);
		seq_indent(seq, iter->depth);
		seq_printf(seq, "  |-- " NIPQUAD_FMT "\n", NIPQUAD(val));
		seq_printf(seq, "  |-- %pI4\n", &val);


		hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
		hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
			struct fib_alias *fa;
			struct fib_alias *fa;
+10 −14
Original line number Original line Diff line number Diff line
@@ -683,10 +683,8 @@ static void icmp_unreach(struct sk_buff *skb)
			break;
			break;
		case ICMP_FRAG_NEEDED:
		case ICMP_FRAG_NEEDED:
			if (ipv4_config.no_pmtu_disc) {
			if (ipv4_config.no_pmtu_disc) {
				LIMIT_NETDEBUG(KERN_INFO "ICMP: " NIPQUAD_FMT ": "
				LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set.\n",
							 "fragmentation needed "
					       &iph->daddr);
							 "and DF set.\n",
					       NIPQUAD(iph->daddr));
			} else {
			} else {
				info = ip_rt_frag_needed(net, iph,
				info = ip_rt_frag_needed(net, iph,
							 ntohs(icmph->un.frag.mtu),
							 ntohs(icmph->un.frag.mtu),
@@ -696,9 +694,8 @@ static void icmp_unreach(struct sk_buff *skb)
			}
			}
			break;
			break;
		case ICMP_SR_FAILED:
		case ICMP_SR_FAILED:
			LIMIT_NETDEBUG(KERN_INFO "ICMP: " NIPQUAD_FMT ": Source "
			LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed.\n",
						 "Route Failed.\n",
				       &iph->daddr);
				       NIPQUAD(iph->daddr));
			break;
			break;
		default:
		default:
			break;
			break;
@@ -729,12 +726,12 @@ static void icmp_unreach(struct sk_buff *skb)
	if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses &&
	if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses &&
	    inet_addr_type(net, iph->daddr) == RTN_BROADCAST) {
	    inet_addr_type(net, iph->daddr) == RTN_BROADCAST) {
		if (net_ratelimit())
		if (net_ratelimit())
			printk(KERN_WARNING NIPQUAD_FMT " sent an invalid ICMP "
			printk(KERN_WARNING "%pI4 sent an invalid ICMP "
					    "type %u, code %u "
					    "type %u, code %u "
					    "error to a broadcast: " NIPQUAD_FMT " on %s\n",
					    "error to a broadcast: %pI4 on %s\n",
			       NIPQUAD(ip_hdr(skb)->saddr),
			       &ip_hdr(skb)->saddr,
			       icmph->type, icmph->code,
			       icmph->type, icmph->code,
			       NIPQUAD(iph->daddr),
			       &iph->daddr,
			       skb->dev->name);
			       skb->dev->name);
		goto out;
		goto out;
	}
	}
@@ -952,9 +949,8 @@ static void icmp_address_reply(struct sk_buff *skb)
				break;
				break;
		}
		}
		if (!ifa && net_ratelimit()) {
		if (!ifa && net_ratelimit()) {
			printk(KERN_INFO "Wrong address mask " NIPQUAD_FMT " from "
			printk(KERN_INFO "Wrong address mask %pI4 from %s/%pI4\n",
					 "%s/" NIPQUAD_FMT "\n",
			       mp, dev->name, &rt->rt_src);
			       NIPQUAD(*mp), dev->name, NIPQUAD(rt->rt_src));
		}
		}
	}
	}
	rcu_read_unlock();
	rcu_read_unlock();
+2 −3
Original line number Original line Diff line number Diff line
@@ -559,9 +559,8 @@ out_nomem:
	goto out_fail;
	goto out_fail;
out_oversize:
out_oversize:
	if (net_ratelimit())
	if (net_ratelimit())
		printk(KERN_INFO
		printk(KERN_INFO "Oversized IP packet from %pI4.\n",
			"Oversized IP packet from " NIPQUAD_FMT ".\n",
			&qp->saddr);
			NIPQUAD(qp->saddr));
out_fail:
out_fail:
	IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMFAILS);
	IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMFAILS);
	return err;
	return err;
Loading