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

Commit 21454aaa authored by Harvey Harrison's avatar Harvey Harrison Committed by David S. Miller
Browse files

net: replace NIPQUAD() in net/*/



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 14d5e834
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -822,8 +822,8 @@ static void atmarp_info(struct seq_file *seq, struct net_device *dev,
	seq_printf(seq, "%-6s%-4s%-4s%5ld ",
	seq_printf(seq, "%-6s%-4s%-4s%5ld ",
		   dev->name, svc ? "SVC" : "PVC", llc ? "LLC" : "NULL", exp);
		   dev->name, svc ? "SVC" : "PVC", llc ? "LLC" : "NULL", exp);


	off = scnprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d",
	off = scnprintf(buf, sizeof(buf) - 1, "%pI4",
			NIPQUAD(entry->ip));
			&entry->ip);
	while (off < 16)
	while (off < 16)
		buf[off++] = ' ';
		buf[off++] = ' ';
	buf[off] = '\0';
	buf[off] = '\0';
+14 −12
Original line number Original line Diff line number Diff line
@@ -232,8 +232,8 @@ void atm_mpoa_disp_qos(struct seq_file *m)
	seq_printf(m, "IP address\n  TX:max_pcr pcr     min_pcr max_cdv max_sdu\n  RX:max_pcr pcr     min_pcr max_cdv max_sdu\n");
	seq_printf(m, "IP address\n  TX:max_pcr pcr     min_pcr max_cdv max_sdu\n  RX:max_pcr pcr     min_pcr max_cdv max_sdu\n");


	while (qos != NULL) {
	while (qos != NULL) {
		seq_printf(m, "%u.%u.%u.%u\n     %-7d %-7d %-7d %-7d %-7d\n     %-7d %-7d %-7d %-7d %-7d\n",
		seq_printf(m, "%pI4\n     %-7d %-7d %-7d %-7d %-7d\n     %-7d %-7d %-7d %-7d %-7d\n",
				NIPQUAD(qos->ipaddr),
				&qos->ipaddr,
				qos->qos.txtp.max_pcr, qos->qos.txtp.pcr, qos->qos.txtp.min_pcr, qos->qos.txtp.max_cdv, qos->qos.txtp.max_sdu,
				qos->qos.txtp.max_pcr, qos->qos.txtp.pcr, qos->qos.txtp.min_pcr, qos->qos.txtp.max_cdv, qos->qos.txtp.max_sdu,
				qos->qos.rxtp.max_pcr, qos->qos.rxtp.pcr, qos->qos.rxtp.min_pcr, qos->qos.rxtp.max_cdv, qos->qos.rxtp.max_sdu);
				qos->qos.rxtp.max_pcr, qos->qos.rxtp.pcr, qos->qos.rxtp.min_pcr, qos->qos.rxtp.max_cdv, qos->qos.rxtp.max_sdu);
		qos = qos->next;
		qos = qos->next;
@@ -595,8 +595,8 @@ static int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
			if (in_entry != NULL) mpc->in_ops->put(in_entry);
			if (in_entry != NULL) mpc->in_ops->put(in_entry);
			return -EINVAL;
			return -EINVAL;
		}
		}
		printk("mpoa: (%s) mpc_vcc_attach: attaching ingress SVC, entry = %u.%u.%u.%u\n",
		printk("mpoa: (%s) mpc_vcc_attach: attaching ingress SVC, entry = %pI4\n",
		       mpc->dev->name, NIPQUAD(in_entry->ctrl_info.in_dst_ip));
		       mpc->dev->name, &in_entry->ctrl_info.in_dst_ip);
		in_entry->shortcut = vcc;
		in_entry->shortcut = vcc;
		mpc->in_ops->put(in_entry);
		mpc->in_ops->put(in_entry);
	} else {
	} else {
@@ -627,8 +627,8 @@ static void mpc_vcc_close(struct atm_vcc *vcc, struct net_device *dev)
	dprintk("mpoa: (%s) mpc_vcc_close:\n", dev->name);
	dprintk("mpoa: (%s) mpc_vcc_close:\n", dev->name);
	in_entry = mpc->in_ops->get_by_vcc(vcc, mpc);
	in_entry = mpc->in_ops->get_by_vcc(vcc, mpc);
	if (in_entry) {
	if (in_entry) {
		dprintk("mpoa: (%s) mpc_vcc_close: ingress SVC closed ip = %u.%u.%u.%u\n",
		dprintk("mpoa: (%s) mpc_vcc_close: ingress SVC closed ip = %pI4\n",
		       mpc->dev->name, NIPQUAD(in_entry->ctrl_info.in_dst_ip));
		       mpc->dev->name, &in_entry->ctrl_info.in_dst_ip);
		in_entry->shortcut = NULL;
		in_entry->shortcut = NULL;
		mpc->in_ops->put(in_entry);
		mpc->in_ops->put(in_entry);
	}
	}
@@ -1098,7 +1098,8 @@ static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_clien
				    entry->shortcut = eg_entry->shortcut;
				    entry->shortcut = eg_entry->shortcut;
		}
		}
		if(entry->shortcut){
		if(entry->shortcut){
			dprintk("mpoa: (%s) using egress SVC to reach %u.%u.%u.%u\n",client->dev->name, NIPQUAD(dst_ip));
			dprintk("mpoa: (%s) using egress SVC to reach %pI4\n",
				client->dev->name, &dst_ip);
			client->eg_ops->put(eg_entry);
			client->eg_ops->put(eg_entry);
			return;
			return;
		}
		}
@@ -1123,7 +1124,8 @@ static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
	__be32 dst_ip = msg->content.in_info.in_dst_ip;
	__be32 dst_ip = msg->content.in_info.in_dst_ip;
	in_cache_entry *entry = mpc->in_ops->get(dst_ip, mpc);
	in_cache_entry *entry = mpc->in_ops->get(dst_ip, mpc);


	dprintk("mpoa: (%s) MPOA_res_reply_rcvd: ip %u.%u.%u.%u\n", mpc->dev->name, NIPQUAD(dst_ip));
	dprintk("mpoa: (%s) MPOA_res_reply_rcvd: ip %pI4\n",
		mpc->dev->name, &dst_ip);
	ddprintk("mpoa: (%s) MPOA_res_reply_rcvd() entry = %p", mpc->dev->name, entry);
	ddprintk("mpoa: (%s) MPOA_res_reply_rcvd() entry = %p", mpc->dev->name, entry);
	if(entry == NULL){
	if(entry == NULL){
		printk("\nmpoa: (%s) ARGH, received res. reply for an entry that doesn't exist.\n", mpc->dev->name);
		printk("\nmpoa: (%s) ARGH, received res. reply for an entry that doesn't exist.\n", mpc->dev->name);
@@ -1171,14 +1173,14 @@ static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
	in_cache_entry *entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask);
	in_cache_entry *entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask);


	if(entry == NULL){
	if(entry == NULL){
		printk("mpoa: (%s) ingress_purge_rcvd: purge for a non-existing entry, ", mpc->dev->name);
		printk("mpoa: (%s) ingress_purge_rcvd: purge for a non-existing entry, ip = %pI4\n",
		printk("ip = %u.%u.%u.%u\n", NIPQUAD(dst_ip));
		       mpc->dev->name, &dst_ip);
		return;
		return;
	}
	}


	do {
	do {
		dprintk("mpoa: (%s) ingress_purge_rcvd: removing an ingress entry, ip = %u.%u.%u.%u\n" ,
		dprintk("mpoa: (%s) ingress_purge_rcvd: removing an ingress entry, ip = %pI4\n",
			mpc->dev->name, NIPQUAD(dst_ip));
			mpc->dev->name, &dst_ip);
		write_lock_bh(&mpc->ingress_lock);
		write_lock_bh(&mpc->ingress_lock);
		mpc->in_ops->remove_entry(entry, mpc);
		mpc->in_ops->remove_entry(entry, mpc);
		write_unlock_bh(&mpc->ingress_lock);
		write_unlock_bh(&mpc->ingress_lock);
+11 −7
Original line number Original line Diff line number Diff line
@@ -94,7 +94,7 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip,
		return NULL;
		return NULL;
	}
	}


	dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u\n", NIPQUAD(dst_ip));
	dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %pI4\n", &dst_ip);


	atomic_set(&entry->use, 1);
	atomic_set(&entry->use, 1);
	dprintk("mpoa: mpoa_caches.c: new_in_cache_entry: about to lock\n");
	dprintk("mpoa: mpoa_caches.c: new_in_cache_entry: about to lock\n");
@@ -150,7 +150,8 @@ static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc)


	if( entry->count > mpc->parameters.mpc_p1 &&
	if( entry->count > mpc->parameters.mpc_p1 &&
	    entry->entry_state == INGRESS_INVALID){
	    entry->entry_state == INGRESS_INVALID){
		dprintk("mpoa: (%s) mpoa_caches.c: threshold exceeded for ip %u.%u.%u.%u, sending MPOA res req\n", mpc->dev->name, NIPQUAD(entry->ctrl_info.in_dst_ip));
		dprintk("mpoa: (%s) mpoa_caches.c: threshold exceeded for ip %pI4, sending MPOA res req\n",
			mpc->dev->name, &entry->ctrl_info.in_dst_ip);
		entry->entry_state = INGRESS_RESOLVING;
		entry->entry_state = INGRESS_RESOLVING;
		msg.type =  SND_MPOA_RES_RQST;
		msg.type =  SND_MPOA_RES_RQST;
		memcpy(msg.MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN );
		memcpy(msg.MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN );
@@ -184,7 +185,8 @@ static void in_cache_remove_entry(in_cache_entry *entry,
	struct k_message msg;
	struct k_message msg;


	vcc = entry->shortcut;
	vcc = entry->shortcut;
	dprintk("mpoa: mpoa_caches.c: removing an ingress entry, ip = %u.%u.%u.%u\n",NIPQUAD(entry->ctrl_info.in_dst_ip));
	dprintk("mpoa: mpoa_caches.c: removing an ingress entry, ip = %pI4\n",
		&entry->ctrl_info.in_dst_ip);


	if (entry->prev != NULL)
	if (entry->prev != NULL)
		entry->prev->next = entry->next;
		entry->prev->next = entry->next;
@@ -228,7 +230,8 @@ static void clear_count_and_expired(struct mpoa_client *client)
		next_entry = entry->next;
		next_entry = entry->next;
		if((now.tv_sec - entry->tv.tv_sec)
		if((now.tv_sec - entry->tv.tv_sec)
		   > entry->ctrl_info.holding_time){
		   > entry->ctrl_info.holding_time){
			dprintk("mpoa: mpoa_caches.c: holding time expired, ip = %u.%u.%u.%u\n", NIPQUAD(entry->ctrl_info.in_dst_ip));
			dprintk("mpoa: mpoa_caches.c: holding time expired, ip = %pI4\n",
				&entry->ctrl_info.in_dst_ip);
			client->in_ops->remove_entry(entry, client);
			client->in_ops->remove_entry(entry, client);
		}
		}
		entry = next_entry;
		entry = next_entry;
@@ -453,7 +456,8 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_cli
		return NULL;
		return NULL;
	}
	}


	dprintk("mpoa: mpoa_caches.c: adding an egress entry, ip = %u.%u.%u.%u, this should be our IP\n", NIPQUAD(msg->content.eg_info.eg_dst_ip));
	dprintk("mpoa: mpoa_caches.c: adding an egress entry, ip = %pI4, this should be our IP\n",
		&msg->content.eg_info.eg_dst_ip);


	atomic_set(&entry->use, 1);
	atomic_set(&entry->use, 1);
	dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock\n");
	dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock\n");
@@ -469,8 +473,8 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_cli
	do_gettimeofday(&(entry->tv));
	do_gettimeofday(&(entry->tv));
	entry->entry_state = EGRESS_RESOLVED;
	entry->entry_state = EGRESS_RESOLVED;
	dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry cache_id %lu\n", ntohl(entry->ctrl_info.cache_id));
	dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry cache_id %lu\n", ntohl(entry->ctrl_info.cache_id));
	dprintk("mpoa: mpoa_caches.c: mps_ip = %u.%u.%u.%u\n",
	dprintk("mpoa: mpoa_caches.c: mps_ip = %pI4\n",
		NIPQUAD(entry->ctrl_info.mps_ip));
		&entry->ctrl_info.mps_ip);
	atomic_inc(&entry->use);
	atomic_inc(&entry->use);


	write_unlock_irq(&client->egress_lock);
	write_unlock_irq(&client->egress_lock);
+4 −8
Original line number Original line Diff line number Diff line
@@ -79,7 +79,6 @@ print_ports(const struct sk_buff *skb, uint8_t protocol, int offset)
	}
	}
}
}


#define myNIPQUAD(a) a[0], a[1], a[2], a[3]
static void
static void
ebt_log_packet(u_int8_t pf, unsigned int hooknum,
ebt_log_packet(u_int8_t pf, unsigned int hooknum,
   const struct sk_buff *skb, const struct net_device *in,
   const struct sk_buff *skb, const struct net_device *in,
@@ -113,9 +112,8 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum,
			printk(" INCOMPLETE IP header");
			printk(" INCOMPLETE IP header");
			goto out;
			goto out;
		}
		}
		printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u, IP "
		printk(" IP SRC=%pI4 IP DST=%pI4, IP tos=0x%02X, IP proto=%d",
		       "tos=0x%02X, IP proto=%d", NIPQUAD(ih->saddr),
		       &ih->saddr, &ih->daddr, ih->tos, ih->protocol);
		       NIPQUAD(ih->daddr), ih->tos, ih->protocol);
		print_ports(skb, ih->protocol, ih->ihl*4);
		print_ports(skb, ih->protocol, ih->ihl*4);
		goto out;
		goto out;
	}
	}
@@ -175,12 +173,10 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum,
			}
			}
			printk(" ARP MAC SRC=");
			printk(" ARP MAC SRC=");
			print_MAC(ap->mac_src);
			print_MAC(ap->mac_src);
			printk(" ARP IP SRC=%u.%u.%u.%u",
			printk(" ARP IP SRC=%pI4", ap->ip_src);
			       myNIPQUAD(ap->ip_src));
			printk(" ARP MAC DST=");
			printk(" ARP MAC DST=");
			print_MAC(ap->mac_dst);
			print_MAC(ap->mac_dst);
			printk(" ARP IP DST=%u.%u.%u.%u",
			printk(" ARP IP DST=%pI4", ap->ip_dst);
			       myNIPQUAD(ap->ip_dst));
		}
		}
	}
	}
out:
out:
+3 −5
Original line number Original line Diff line number Diff line
@@ -792,12 +792,10 @@ static int dccp_v4_rcv(struct sk_buff *skb)
	DCCP_SKB_CB(skb)->dccpd_seq  = dccp_hdr_seq(dh);
	DCCP_SKB_CB(skb)->dccpd_seq  = dccp_hdr_seq(dh);
	DCCP_SKB_CB(skb)->dccpd_type = dh->dccph_type;
	DCCP_SKB_CB(skb)->dccpd_type = dh->dccph_type;


	dccp_pr_debug("%8.8s "
	dccp_pr_debug("%8.8s src=%pI4@%-5d dst=%pI4@%-5d seq=%llu",
		      "src=%u.%u.%u.%u@%-5d "
		      "dst=%u.%u.%u.%u@%-5d seq=%llu",
		      dccp_packet_name(dh->dccph_type),
		      dccp_packet_name(dh->dccph_type),
		      NIPQUAD(iph->saddr), ntohs(dh->dccph_sport),
		      &iph->saddr, ntohs(dh->dccph_sport),
		      NIPQUAD(iph->daddr), ntohs(dh->dccph_dport),
		      &iph->daddr, ntohs(dh->dccph_dport),
		      (unsigned long long) DCCP_SKB_CB(skb)->dccpd_seq);
		      (unsigned long long) DCCP_SKB_CB(skb)->dccpd_seq);


	if (dccp_packet_without_ack(skb)) {
	if (dccp_packet_without_ack(skb)) {
Loading