提交 21454aaa 编写于 作者: H Harvey Harrison 提交者: David S. Miller

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: NHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 14d5e834
...@@ -822,8 +822,8 @@ static void atmarp_info(struct seq_file *seq, struct net_device *dev, ...@@ -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';
......
...@@ -232,8 +232,8 @@ void atm_mpoa_disp_qos(struct seq_file *m) ...@@ -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) ...@@ -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) ...@@ -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 ...@@ -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) ...@@ -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) ...@@ -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);
......
...@@ -94,7 +94,7 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip, ...@@ -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) ...@@ -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, ...@@ -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) ...@@ -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 ...@@ -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 ...@@ -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);
......
...@@ -79,7 +79,6 @@ print_ports(const struct sk_buff *skb, uint8_t protocol, int offset) ...@@ -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, ...@@ -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, ...@@ -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:
......
...@@ -792,12 +792,10 @@ static int dccp_v4_rcv(struct sk_buff *skb) ...@@ -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)) {
......
...@@ -86,18 +86,18 @@ static int jdccp_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -86,18 +86,18 @@ static int jdccp_sendmsg(struct kiocb *iocb, struct sock *sk,
if (port == 0 || ntohs(inet->dport) == port || if (port == 0 || ntohs(inet->dport) == port ||
ntohs(inet->sport) == port) { ntohs(inet->sport) == port) {
if (hctx) if (hctx)
printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %d %d %d %u " printl("%pI4:%u %pI4:%u %d %d %d %d %u "
"%llu %llu %d\n", "%llu %llu %d\n",
NIPQUAD(inet->saddr), ntohs(inet->sport), &inet->saddr, ntohs(inet->sport),
NIPQUAD(inet->daddr), ntohs(inet->dport), size, &inet->daddr, ntohs(inet->dport), size,
hctx->ccid3hctx_s, hctx->ccid3hctx_rtt, hctx->ccid3hctx_s, hctx->ccid3hctx_rtt,
hctx->ccid3hctx_p, hctx->ccid3hctx_x_calc, hctx->ccid3hctx_p, hctx->ccid3hctx_x_calc,
hctx->ccid3hctx_x_recv >> 6, hctx->ccid3hctx_x_recv >> 6,
hctx->ccid3hctx_x >> 6, hctx->ccid3hctx_t_ipi); hctx->ccid3hctx_x >> 6, hctx->ccid3hctx_t_ipi);
else else
printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d\n", printl("%pI4:%u %pI4:%u %d\n",
NIPQUAD(inet->saddr), ntohs(inet->sport), &inet->saddr, ntohs(inet->sport),
NIPQUAD(inet->daddr), ntohs(inet->dport), size); &inet->daddr, ntohs(inet->dport), size);
} }
jprobe_return(); jprobe_return();
......
...@@ -337,7 +337,7 @@ void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, ...@@ -337,7 +337,7 @@ void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
if (dev != NULL) if (dev != NULL)
audit_log_format(audit_buf, " netif=%s", dev); audit_log_format(audit_buf, " netif=%s", dev);
audit_log_format(audit_buf, " %s=" NIPQUAD_FMT, dir, NIPQUAD(addr)); audit_log_format(audit_buf, " %s=%pI4", dir, &addr);
if (mask_val != 0xffffffff) { if (mask_val != 0xffffffff) {
u32 mask_len = 0; u32 mask_len = 0;
while (mask_val > 0) { while (mask_val > 0) {
......
...@@ -96,9 +96,9 @@ static int rxrpc_validate_address(struct rxrpc_sock *rx, ...@@ -96,9 +96,9 @@ static int rxrpc_validate_address(struct rxrpc_sock *rx,
switch (srx->transport.family) { switch (srx->transport.family) {
case AF_INET: case AF_INET:
_debug("INET: %x @ %u.%u.%u.%u", _debug("INET: %x @ %pI4",
ntohs(srx->transport.sin.sin_port), ntohs(srx->transport.sin.sin_port),
NIPQUAD(srx->transport.sin.sin_addr)); &srx->transport.sin.sin_addr);
if (srx->transport_len > 8) if (srx->transport_len > 8)
memset((void *)&srx->transport + 8, 0, memset((void *)&srx->transport + 8, 0,
srx->transport_len - 8); srx->transport_len - 8);
......
...@@ -49,8 +49,7 @@ void rxrpc_UDP_error_report(struct sock *sk) ...@@ -49,8 +49,7 @@ void rxrpc_UDP_error_report(struct sock *sk)
addr = *(__be32 *)(skb_network_header(skb) + serr->addr_offset); addr = *(__be32 *)(skb_network_header(skb) + serr->addr_offset);
port = serr->port; port = serr->port;
_net("Rx UDP Error from "NIPQUAD_FMT":%hu", _net("Rx UDP Error from %pI4:%hu", &addr, ntohs(port));
NIPQUAD(addr), ntohs(port));
_debug("Msg l:%d d:%d", skb->len, skb->data_len); _debug("Msg l:%d d:%d", skb->len, skb->data_len);
peer = rxrpc_find_peer(local, addr, port); peer = rxrpc_find_peer(local, addr, port);
......
...@@ -131,10 +131,10 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx) ...@@ -131,10 +131,10 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx)
struct rxrpc_local *local; struct rxrpc_local *local;
int ret; int ret;
_enter("{%d,%u,%u.%u.%u.%u+%hu}", _enter("{%d,%u,%pI4+%hu}",
srx->transport_type, srx->transport_type,
srx->transport.family, srx->transport.family,
NIPQUAD(srx->transport.sin.sin_addr), &srx->transport.sin.sin_addr,
ntohs(srx->transport.sin.sin_port)); ntohs(srx->transport.sin.sin_port));
down_write(&rxrpc_local_sem); down_write(&rxrpc_local_sem);
...@@ -143,10 +143,10 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx) ...@@ -143,10 +143,10 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx)
read_lock_bh(&rxrpc_local_lock); read_lock_bh(&rxrpc_local_lock);
list_for_each_entry(local, &rxrpc_locals, link) { list_for_each_entry(local, &rxrpc_locals, link) {
_debug("CMP {%d,%u,%u.%u.%u.%u+%hu}", _debug("CMP {%d,%u,%pI4+%hu}",
local->srx.transport_type, local->srx.transport_type,
local->srx.transport.family, local->srx.transport.family,
NIPQUAD(local->srx.transport.sin.sin_addr), &local->srx.transport.sin.sin_addr,
ntohs(local->srx.transport.sin.sin_port)); ntohs(local->srx.transport.sin.sin_port));
if (local->srx.transport_type != srx->transport_type || if (local->srx.transport_type != srx->transport_type ||
...@@ -188,11 +188,11 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx) ...@@ -188,11 +188,11 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx)
up_write(&rxrpc_local_sem); up_write(&rxrpc_local_sem);
_net("LOCAL new %d {%d,%u,%u.%u.%u.%u+%hu}", _net("LOCAL new %d {%d,%u,%pI4+%hu}",
local->debug_id, local->debug_id,
local->srx.transport_type, local->srx.transport_type,
local->srx.transport.family, local->srx.transport.family,
NIPQUAD(local->srx.transport.sin.sin_addr), &local->srx.transport.sin.sin_addr,
ntohs(local->srx.transport.sin.sin_port)); ntohs(local->srx.transport.sin.sin_port));
_leave(" = %p [new]", local); _leave(" = %p [new]", local);
...@@ -203,11 +203,11 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx) ...@@ -203,11 +203,11 @@ struct rxrpc_local *rxrpc_lookup_local(struct sockaddr_rxrpc *srx)
read_unlock_bh(&rxrpc_local_lock); read_unlock_bh(&rxrpc_local_lock);
up_write(&rxrpc_local_sem); up_write(&rxrpc_local_sem);
_net("LOCAL old %d {%d,%u,%u.%u.%u.%u+%hu}", _net("LOCAL old %d {%d,%u,%pI4+%hu}",
local->debug_id, local->debug_id,
local->srx.transport_type, local->srx.transport_type,
local->srx.transport.family, local->srx.transport.family,
NIPQUAD(local->srx.transport.sin.sin_addr), &local->srx.transport.sin.sin_addr,
ntohs(local->srx.transport.sin.sin_port)); ntohs(local->srx.transport.sin.sin_port));
_leave(" = %p [reuse]", local); _leave(" = %p [reuse]", local);
......
...@@ -123,10 +123,10 @@ struct rxrpc_peer *rxrpc_get_peer(struct sockaddr_rxrpc *srx, gfp_t gfp) ...@@ -123,10 +123,10 @@ struct rxrpc_peer *rxrpc_get_peer(struct sockaddr_rxrpc *srx, gfp_t gfp)
const char *new = "old"; const char *new = "old";
int usage; int usage;
_enter("{%d,%d,%u.%u.%u.%u+%hu}", _enter("{%d,%d,%pI4+%hu}",
srx->transport_type, srx->transport_type,
srx->transport_len, srx->transport_len,
NIPQUAD(srx->transport.sin.sin_addr), &srx->transport.sin.sin_addr,
ntohs(srx->transport.sin.sin_port)); ntohs(srx->transport.sin.sin_port));
/* search the peer list first */ /* search the peer list first */
...@@ -177,12 +177,12 @@ struct rxrpc_peer *rxrpc_get_peer(struct sockaddr_rxrpc *srx, gfp_t gfp) ...@@ -177,12 +177,12 @@ struct rxrpc_peer *rxrpc_get_peer(struct sockaddr_rxrpc *srx, gfp_t gfp)
new = "new"; new = "new";
success: success:
_net("PEER %s %d {%d,%u,%u.%u.%u.%u+%hu}", _net("PEER %s %d {%d,%u,%pI4+%hu}",
new, new,
peer->debug_id, peer->debug_id,
peer->srx.transport_type, peer->srx.transport_type,
peer->srx.transport.family, peer->srx.transport.family,
NIPQUAD(peer->srx.transport.sin.sin_addr), &peer->srx.transport.sin.sin_addr,
ntohs(peer->srx.transport.sin.sin_port)); ntohs(peer->srx.transport.sin.sin_port));
_leave(" = %p {u=%d}", peer, atomic_read(&peer->usage)); _leave(" = %p {u=%d}", peer, atomic_read(&peer->usage));
......
...@@ -61,12 +61,12 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v) ...@@ -61,12 +61,12 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)
call = list_entry(v, struct rxrpc_call, link); call = list_entry(v, struct rxrpc_call, link);
trans = call->conn->trans; trans = call->conn->trans;
sprintf(lbuff, NIPQUAD_FMT":%u", sprintf(lbuff, "%pI4:%u",
NIPQUAD(trans->local->srx.transport.sin.sin_addr), &trans->local->srx.transport.sin.sin_addr,
ntohs(trans->local->srx.transport.sin.sin_port)); ntohs(trans->local->srx.transport.sin.sin_port));
sprintf(rbuff, NIPQUAD_FMT":%u", sprintf(rbuff, "%pI4:%u",
NIPQUAD(trans->peer->srx.transport.sin.sin_addr), &trans->peer->srx.transport.sin.sin_addr,
ntohs(trans->peer->srx.transport.sin.sin_port)); ntohs(trans->peer->srx.transport.sin.sin_port));
seq_printf(seq, seq_printf(seq,
...@@ -144,12 +144,12 @@ static int rxrpc_connection_seq_show(struct seq_file *seq, void *v) ...@@ -144,12 +144,12 @@ static int rxrpc_connection_seq_show(struct seq_file *seq, void *v)
conn = list_entry(v, struct rxrpc_connection, link); conn = list_entry(v, struct rxrpc_connection, link);
trans = conn->trans; trans = conn->trans;
sprintf(lbuff, NIPQUAD_FMT":%u", sprintf(lbuff, "%pI4:%u",
NIPQUAD(trans->local->srx.transport.sin.sin_addr), &trans->local->srx.transport.sin.sin_addr,
ntohs(trans->local->srx.transport.sin.sin_port)); ntohs(trans->local->srx.transport.sin.sin_port));
sprintf(rbuff, NIPQUAD_FMT":%u", sprintf(rbuff, "%pI4:%u",
NIPQUAD(trans->peer->srx.transport.sin.sin_addr), &trans->peer->srx.transport.sin.sin_addr,
ntohs(trans->peer->srx.transport.sin.sin_port)); ntohs(trans->peer->srx.transport.sin.sin_port));
seq_printf(seq, seq_printf(seq,
......
...@@ -78,10 +78,10 @@ struct rxrpc_transport *rxrpc_get_transport(struct rxrpc_local *local, ...@@ -78,10 +78,10 @@ struct rxrpc_transport *rxrpc_get_transport(struct rxrpc_local *local,
const char *new = "old"; const char *new = "old";
int usage; int usage;
_enter("{%u.%u.%u.%u+%hu},{%u.%u.%u.%u+%hu},", _enter("{%pI4+%hu},{%pI4+%hu},",
NIPQUAD(local->srx.transport.sin.sin_addr), &local->srx.transport.sin.sin_addr,
ntohs(local->srx.transport.sin.sin_port), ntohs(local->srx.transport.sin.sin_port),
NIPQUAD(peer->srx.transport.sin.sin_addr), &peer->srx.transport.sin.sin_addr,
ntohs(peer->srx.transport.sin.sin_port)); ntohs(peer->srx.transport.sin.sin_port));
/* search the transport list first */ /* search the transport list first */
...@@ -149,10 +149,10 @@ struct rxrpc_transport *rxrpc_find_transport(struct rxrpc_local *local, ...@@ -149,10 +149,10 @@ struct rxrpc_transport *rxrpc_find_transport(struct rxrpc_local *local,
{ {
struct rxrpc_transport *trans; struct rxrpc_transport *trans;
_enter("{%u.%u.%u.%u+%hu},{%u.%u.%u.%u+%hu},", _enter("{%pI4+%hu},{%pI4+%hu},",
NIPQUAD(local->srx.transport.sin.sin_addr), &local->srx.transport.sin.sin_addr,
ntohs(local->srx.transport.sin.sin_port), ntohs(local->srx.transport.sin.sin_port),
NIPQUAD(peer->srx.transport.sin.sin_addr), &peer->srx.transport.sin.sin_addr,
ntohs(peer->srx.transport.sin.sin_port)); ntohs(peer->srx.transport.sin.sin_port));
/* search the transport list */ /* search the transport list */
......
...@@ -897,7 +897,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, ...@@ -897,7 +897,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
/* get the IPv4 address of the entity that requested the ticket */ /* get the IPv4 address of the entity that requested the ticket */
memcpy(&addr, p, sizeof(addr)); memcpy(&addr, p, sizeof(addr));
p += 4; p += 4;
_debug("KIV ADDR : "NIPQUAD_FMT, NIPQUAD(addr)); _debug("KIV ADDR : %pI4", &addr);
/* get the session key from the ticket */ /* get the session key from the ticket */
memcpy(&key, p, sizeof(key)); memcpy(&key, p, sizeof(key));
......
...@@ -482,9 +482,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, ...@@ -482,9 +482,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
if (saddr) if (saddr)
fl.fl4_src = saddr->v4.sin_addr.s_addr; fl.fl4_src = saddr->v4.sin_addr.s_addr;
SCTP_DEBUG_PRINTK("%s: DST:%u.%u.%u.%u, SRC:%u.%u.%u.%u - ", SCTP_DEBUG_PRINTK("%s: DST:%pI4, SRC:%pI4 - ",
__func__, NIPQUAD(fl.fl4_dst), __func__, &fl.fl4_dst, &fl.fl4_src);
NIPQUAD(fl.fl4_src));
if (!ip_route_output_key(&init_net, &rt, &fl)) { if (!ip_route_output_key(&init_net, &rt, &fl)) {
dst = &rt->u.dst; dst = &rt->u.dst;
...@@ -540,8 +539,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, ...@@ -540,8 +539,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
rcu_read_unlock(); rcu_read_unlock();
out: out:
if (dst) if (dst)
SCTP_DEBUG_PRINTK("rt_dst:%u.%u.%u.%u, rt_src:%u.%u.%u.%u\n", SCTP_DEBUG_PRINTK("rt_dst:%pI4, rt_src:%pI4\n",
NIPQUAD(rt->rt_dst), NIPQUAD(rt->rt_src)); &rt->rt_dst, &rt->rt_src);
else else
SCTP_DEBUG_PRINTK("NO ROUTE\n"); SCTP_DEBUG_PRINTK("NO ROUTE\n");
...@@ -646,7 +645,7 @@ static void sctp_v4_addr_v4map(struct sctp_sock *sp, union sctp_addr *addr) ...@@ -646,7 +645,7 @@ static void sctp_v4_addr_v4map(struct sctp_sock *sp, union sctp_addr *addr)
/* Dump the v4 addr to the seq file. */ /* Dump the v4 addr to the seq file. */
static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
{ {
seq_printf(seq, "%d.%d.%d.%d ", NIPQUAD(addr->v4.sin_addr)); seq_printf(seq, "%pI4 ", &addr->v4.sin_addr);
} }
static void sctp_v4_ecn_capable(struct sock *sk) static void sctp_v4_ecn_capable(struct sock *sk)
...@@ -866,11 +865,10 @@ static inline int sctp_v4_xmit(struct sk_buff *skb, ...@@ -866,11 +865,10 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
{ {
struct inet_sock *inet = inet_sk(skb->sk); struct inet_sock *inet = inet_sk(skb->sk);
SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, src:%pI4, dst:%pI4\n",
"src:%u.%u.%u.%u, dst:%u.%u.%u.%u\n",
__func__, skb, skb->len, __func__, skb, skb->len,
NIPQUAD(skb->rtable->rt_src), &skb->rtable->rt_src,
NIPQUAD(skb->rtable->rt_dst)); &skb->rtable->rt_dst);
inet->pmtudisc = transport->param_flags & SPP_PMTUD_ENABLE ? inet->pmtudisc = transport->param_flags & SPP_PMTUD_ENABLE ?
IP_PMTUDISC_DO : IP_PMTUDISC_DONT; IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
......
...@@ -1130,11 +1130,10 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, ...@@ -1130,11 +1130,10 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
} else { } else {
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_WARNING printk(KERN_WARNING
"%s association %p could not find address " "%s association %p could not find address %pI4\n",
NIPQUAD_FMT "\n",
__func__, __func__,
asoc, asoc,
NIPQUAD(from_addr.v4.sin_addr.s_addr)); &from_addr.v4.sin_addr.s_addr);
} }
return SCTP_DISPOSITION_DISCARD; return SCTP_DISPOSITION_DISCARD;
} }
......
...@@ -271,8 +271,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) ...@@ -271,8 +271,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
case AF_INET: { case AF_INET: {
struct sockaddr_in *sin = struct sockaddr_in *sin =
(struct sockaddr_in *)args->address; (struct sockaddr_in *)args->address;
snprintf(servername, sizeof(servername), NIPQUAD_FMT, snprintf(servername, sizeof(servername), "%pI4",
NIPQUAD(sin->sin_addr.s_addr)); &sin->sin_addr.s_addr);
break; break;
} }
case AF_INET6: { case AF_INET6: {
......
...@@ -270,10 +270,9 @@ static int rpcb_register_netid4(struct sockaddr_in *address_to_register, ...@@ -270,10 +270,9 @@ static int rpcb_register_netid4(struct sockaddr_in *address_to_register,
char buf[32]; char buf[32];
/* Construct AF_INET universal address */ /* Construct AF_INET universal address */
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf), "%pI4.%u.%u",
NIPQUAD_FMT".%u.%u", &address_to_register->sin_addr.s_addr,
NIPQUAD(address_to_register->sin_addr.s_addr), port >> 8, port & 0xff);
port >> 8, port & 0xff);
map->r_addr = buf; map->r_addr = buf;
dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with "
...@@ -422,8 +421,8 @@ int rpcb_getport_sync(struct sockaddr_in *sin, u32 prog, u32 vers, int prot) ...@@ -422,8 +421,8 @@ int rpcb_getport_sync(struct sockaddr_in *sin, u32 prog, u32 vers, int prot)
struct rpc_clnt *rpcb_clnt; struct rpc_clnt *rpcb_clnt;
int status; int status;
dprintk("RPC: %s(" NIPQUAD_FMT ", %u, %u, %d)\n", dprintk("RPC: %s(%pI4, %u, %u, %d)\n",
__func__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot); __func__, &sin->sin_addr.s_addr, prog, vers, prot);
rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin, rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin,
sizeof(*sin), prot, RPCBVERS_2); sizeof(*sin), prot, RPCBVERS_2);
......
...@@ -162,11 +162,7 @@ static void ip_map_request(struct cache_detail *cd, ...@@ -162,11 +162,7 @@ static void ip_map_request(struct cache_detail *cd,
struct ip_map *im = container_of(h, struct ip_map, h); struct ip_map *im = container_of(h, struct ip_map, h);
if (ipv6_addr_v4mapped(&(im->m_addr))) { if (ipv6_addr_v4mapped(&(im->m_addr))) {
snprintf(text_addr, 20, NIPQUAD_FMT, snprintf(text_addr, 20, "%pI4", &im->m_addr.s6_addr32[3]);
ntohl(im->m_addr.s6_addr32[3]) >> 24 & 0xff,
ntohl(im->m_addr.s6_addr32[3]) >> 16 & 0xff,
ntohl(im->m_addr.s6_addr32[3]) >> 8 & 0xff,
ntohl(im->m_addr.s6_addr32[3]) >> 0 & 0xff);
} else { } else {
snprintf(text_addr, 40, "%pI6", &im->m_addr); snprintf(text_addr, 40, "%pI6", &im->m_addr);
} }
...@@ -208,7 +204,7 @@ static int ip_map_parse(struct cache_detail *cd, ...@@ -208,7 +204,7 @@ static int ip_map_parse(struct cache_detail *cd,
len = qword_get(&mesg, buf, mlen); len = qword_get(&mesg, buf, mlen);
if (len <= 0) return -EINVAL; if (len <= 0) return -EINVAL;
if (sscanf(buf, NIPQUAD_FMT "%c", &b1, &b2, &b3, &b4, &c) == 4) { if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) == 4) {
addr.s6_addr32[0] = 0; addr.s6_addr32[0] = 0;
addr.s6_addr32[1] = 0; addr.s6_addr32[1] = 0;
addr.s6_addr32[2] = htonl(0xffff); addr.s6_addr32[2] = htonl(0xffff);
...@@ -278,13 +274,8 @@ static int ip_map_show(struct seq_file *m, ...@@ -278,13 +274,8 @@ static int ip_map_show(struct seq_file *m,
dom = im->m_client->h.name; dom = im->m_client->h.name;
if (ipv6_addr_v4mapped(&addr)) { if (ipv6_addr_v4mapped(&addr)) {
seq_printf(m, "%s " NIPQUAD_FMT " %s\n", seq_printf(m, "%s %pI4 %s\n",
im->m_class, im->m_class, &addr.s6_addr32[3], dom);
ntohl(addr.s6_addr32[3]) >> 24 & 0xff,
ntohl(addr.s6_addr32[3]) >> 16 & 0xff,
ntohl(addr.s6_addr32[3]) >> 8 & 0xff,
ntohl(addr.s6_addr32[3]) >> 0 & 0xff,
dom);
} else { } else {
seq_printf(m, "%s %pI6 %s\n", im->m_class, &addr, dom); seq_printf(m, "%s %pI6 %s\n", im->m_class, &addr, dom);
} }
......
...@@ -250,10 +250,10 @@ static int one_sock_name(char *buf, struct svc_sock *svsk) ...@@ -250,10 +250,10 @@ static int one_sock_name(char *buf, struct svc_sock *svsk)
switch(svsk->sk_sk->sk_family) { switch(svsk->sk_sk->sk_family) {
case AF_INET: case AF_INET:
len = sprintf(buf, "ipv4 %s %u.%u.%u.%u %d\n", len = sprintf(buf, "ipv4 %s %pI4 %d\n",
svsk->sk_sk->sk_protocol==IPPROTO_UDP? svsk->sk_sk->sk_protocol == IPPROTO_UDP ?
"udp" : "tcp", "udp" : "tcp",
NIPQUAD(inet_sk(svsk->sk_sk)->rcv_saddr), &inet_sk(svsk->sk_sk)->rcv_saddr,
inet_sk(svsk->sk_sk)->num); inet_sk(svsk->sk_sk)->num);
break; break;
default: default:
......
...@@ -1048,21 +1048,21 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) ...@@ -1048,21 +1048,21 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
dprintk("svcrdma: new connection %p accepted with the following " dprintk("svcrdma: new connection %p accepted with the following "
"attributes:\n" "attributes:\n"
" local_ip : %d.%d.%d.%d\n" " local_ip : %pI4\n"
" local_port : %d\n" " local_port : %d\n"
" remote_ip : %d.%d.%d.%d\n" " remote_ip : %pI4\n"
" remote_port : %d\n" " remote_port : %d\n"
" max_sge : %d\n" " max_sge : %d\n"
" sq_depth : %d\n" " sq_depth : %d\n"
" max_requests : %d\n" " max_requests : %d\n"
" ord : %d\n", " ord : %d\n",
newxprt, newxprt,
NIPQUAD(((struct sockaddr_in *)&newxprt->sc_cm_id-> &((struct sockaddr_in *)&newxprt->sc_cm_id->
route.addr.src_addr)->sin_addr.s_addr), route.addr.src_addr)->sin_addr.s_addr,
ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
route.addr.src_addr)->sin_port), route.addr.src_addr)->sin_port),
NIPQUAD(((struct sockaddr_in *)&newxprt->sc_cm_id-> &((struct sockaddr_in *)&newxprt->sc_cm_id->
route.addr.dst_addr)->sin_addr.s_addr), route.addr.dst_addr)->sin_addr.s_addr,
ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
route.addr.dst_addr)->sin_port), route.addr.dst_addr)->sin_port),
newxprt->sc_max_sge, newxprt->sc_max_sge,
......
...@@ -174,7 +174,7 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt) ...@@ -174,7 +174,7 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
buf = kzalloc(20, GFP_KERNEL); buf = kzalloc(20, GFP_KERNEL);
if (buf) if (buf)
snprintf(buf, 20, NIPQUAD_FMT, NIPQUAD(addr->sin_addr.s_addr)); snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr);
xprt->address_strings[RPC_DISPLAY_ADDR] = buf; xprt->address_strings[RPC_DISPLAY_ADDR] = buf;
buf = kzalloc(8, GFP_KERNEL); buf = kzalloc(8, GFP_KERNEL);
...@@ -186,8 +186,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt) ...@@ -186,8 +186,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
buf = kzalloc(48, GFP_KERNEL); buf = kzalloc(48, GFP_KERNEL);
if (buf) if (buf)
snprintf(buf, 48, "addr="NIPQUAD_FMT" port=%u proto=%s", snprintf(buf, 48, "addr=%pI4 port=%u proto=%s",
NIPQUAD(addr->sin_addr.s_addr), &addr->sin_addr.s_addr,
ntohs(addr->sin_port), "rdma"); ntohs(addr->sin_port), "rdma");
xprt->address_strings[RPC_DISPLAY_ALL] = buf; xprt->address_strings[RPC_DISPLAY_ALL] = buf;
...@@ -204,8 +204,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt) ...@@ -204,8 +204,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
buf = kzalloc(30, GFP_KERNEL); buf = kzalloc(30, GFP_KERNEL);
if (buf) if (buf)
snprintf(buf, 30, NIPQUAD_FMT".%u.%u", snprintf(buf, 30, "%pI4.%u.%u",
NIPQUAD(addr->sin_addr.s_addr), &addr->sin_addr.s_addr,
ntohs(addr->sin_port) >> 8, ntohs(addr->sin_port) >> 8,
ntohs(addr->sin_port) & 0xff); ntohs(addr->sin_port) & 0xff);
xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf;
...@@ -369,8 +369,8 @@ xprt_setup_rdma(struct xprt_create *args) ...@@ -369,8 +369,8 @@ xprt_setup_rdma(struct xprt_create *args)
if (ntohs(sin->sin_port) != 0) if (ntohs(sin->sin_port) != 0)
xprt_set_bound(xprt); xprt_set_bound(xprt);
dprintk("RPC: %s: %u.%u.%u.%u:%u\n", __func__, dprintk("RPC: %s: %pI4:%u\n",
NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port)); __func__, &sin->sin_addr.s_addr, ntohs(sin->sin_port));
/* Set max requests */ /* Set max requests */
cdata.max_requests = xprt->max_reqs; cdata.max_requests = xprt->max_reqs;
......
...@@ -323,12 +323,11 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event) ...@@ -323,12 +323,11 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event)
case RDMA_CM_EVENT_DEVICE_REMOVAL: case RDMA_CM_EVENT_DEVICE_REMOVAL:
connstate = -ENODEV; connstate = -ENODEV;
connected: connected:
dprintk("RPC: %s: %s: %u.%u.%u.%u:%u" dprintk("RPC: %s: %s: %pI4:%u (ep 0x%p event 0x%x)\n",
" (ep 0x%p event 0x%x)\n",
__func__, __func__,
(event->event <= 11) ? conn[event->event] : (event->event <= 11) ? conn[event->event] :
"unknown connection error", "unknown connection error",
NIPQUAD(addr->sin_addr.s_addr), &addr->sin_addr.s_addr,
ntohs(addr->sin_port), ntohs(addr->sin_port),
ep, event->event); ep, event->event);
atomic_set(&rpcx_to_rdmax(ep->rep_xprt)->rx_buf.rb_credits, 1); atomic_set(&rpcx_to_rdmax(ep->rep_xprt)->rx_buf.rb_credits, 1);
...@@ -348,18 +347,17 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event) ...@@ -348,18 +347,17 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event)
if (connstate == 1) { if (connstate == 1) {
int ird = attr.max_dest_rd_atomic; int ird = attr.max_dest_rd_atomic;
int tird = ep->rep_remote_cma.responder_resources; int tird = ep->rep_remote_cma.responder_resources;
printk(KERN_INFO "rpcrdma: connection to %u.%u.%u.%u:%u " printk(KERN_INFO "rpcrdma: connection to %pI4:%u "
"on %s, memreg %d slots %d ird %d%s\n", "on %s, memreg %d slots %d ird %d%s\n",
NIPQUAD(addr->sin_addr.s_addr), &addr->sin_addr.s_addr,
ntohs(addr->sin_port), ntohs(addr->sin_port),
ia->ri_id->device->name, ia->ri_id->device->name,
ia->ri_memreg_strategy, ia->ri_memreg_strategy,
xprt->rx_buf.rb_max_requests, xprt->rx_buf.rb_max_requests,
ird, ird < 4 && ird < tird / 2 ? " (low!)" : ""); ird, ird < 4 && ird < tird / 2 ? " (low!)" : "");
} else if (connstate < 0) { } else if (connstate < 0) {
printk(KERN_INFO "rpcrdma: connection to %u.%u.%u.%u:%u " printk(KERN_INFO "rpcrdma: connection to %pI4:%u closed (%d)\n",
"closed (%d)\n", &addr->sin_addr.s_addr,
NIPQUAD(addr->sin_addr.s_addr),
ntohs(addr->sin_port), ntohs(addr->sin_port),
connstate); connstate);
} }
......
...@@ -284,8 +284,7 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, ...@@ -284,8 +284,7 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt,
buf = kzalloc(20, GFP_KERNEL); buf = kzalloc(20, GFP_KERNEL);
if (buf) { if (buf) {
snprintf(buf, 20, NIPQUAD_FMT, snprintf(buf, 20, "pI4", &addr->sin_addr.s_addr);
NIPQUAD(addr->sin_addr.s_addr));
} }
xprt->address_strings[RPC_DISPLAY_ADDR] = buf; xprt->address_strings[RPC_DISPLAY_ADDR] = buf;
...@@ -300,8 +299,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, ...@@ -300,8 +299,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt,
buf = kzalloc(48, GFP_KERNEL); buf = kzalloc(48, GFP_KERNEL);
if (buf) { if (buf) {
snprintf(buf, 48, "addr="NIPQUAD_FMT" port=%u proto=%s", snprintf(buf, 48, "addr=%pI4 port=%u proto=%s",
NIPQUAD(addr->sin_addr.s_addr), &addr->sin_addr.s_addr,
ntohs(addr->sin_port), ntohs(addr->sin_port),
protocol); protocol);
} }
...@@ -323,8 +322,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, ...@@ -323,8 +322,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt,
buf = kzalloc(30, GFP_KERNEL); buf = kzalloc(30, GFP_KERNEL);
if (buf) { if (buf) {
snprintf(buf, 30, NIPQUAD_FMT".%u.%u", snprintf(buf, 30, "%pI4.%u.%u",
NIPQUAD(addr->sin_addr.s_addr), &addr->sin_addr.s_addr,
ntohs(addr->sin_port) >> 8, ntohs(addr->sin_port) >> 8,
ntohs(addr->sin_port) & 0xff); ntohs(addr->sin_port) & 0xff);
} }
...@@ -1413,8 +1412,8 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock) ...@@ -1413,8 +1412,8 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock)
if (port > last) if (port > last)
nloop++; nloop++;
} while (err == -EADDRINUSE && nloop != 2); } while (err == -EADDRINUSE && nloop != 2);
dprintk("RPC: %s "NIPQUAD_FMT":%u: %s (%d)\n", dprintk("RPC: %s %pI4:%u: %s (%d)\n",
__func__, NIPQUAD(myaddr.sin_addr), __func__, &myaddr.sin_addr,
port, err ? "failed" : "ok", err); port, err ? "failed" : "ok", err);
return err; return err;
} }
......
...@@ -2455,13 +2455,11 @@ static void xfrm_audit_common_policyinfo(struct xfrm_policy *xp, ...@@ -2455,13 +2455,11 @@ static void xfrm_audit_common_policyinfo(struct xfrm_policy *xp,
switch(sel->family) { switch(sel->family) {
case AF_INET: case AF_INET:
audit_log_format(audit_buf, " src=" NIPQUAD_FMT, audit_log_format(audit_buf, " src=%pI4", &sel->saddr.a4);
NIPQUAD(sel->saddr.a4));
if (sel->prefixlen_s != 32) if (sel->prefixlen_s != 32)
audit_log_format(audit_buf, " src_prefixlen=%d", audit_log_format(audit_buf, " src_prefixlen=%d",
sel->prefixlen_s); sel->prefixlen_s);
audit_log_format(audit_buf, " dst=" NIPQUAD_FMT, audit_log_format(audit_buf, " dst=%pI4", &sel->daddr.a4);
NIPQUAD(sel->daddr.a4));
if (sel->prefixlen_d != 32) if (sel->prefixlen_d != 32)
audit_log_format(audit_buf, " dst_prefixlen=%d", audit_log_format(audit_buf, " dst_prefixlen=%d",
sel->prefixlen_d); sel->prefixlen_d);
......
...@@ -2109,10 +2109,8 @@ static void xfrm_audit_helper_sainfo(struct xfrm_state *x, ...@@ -2109,10 +2109,8 @@ static void xfrm_audit_helper_sainfo(struct xfrm_state *x,
switch(x->props.family) { switch(x->props.family) {
case AF_INET: case AF_INET:
audit_log_format(audit_buf, audit_log_format(audit_buf, " src=%pI4 dst=%pI4",
" src=" NIPQUAD_FMT " dst=" NIPQUAD_FMT, &x->props.saddr.a4, &x->id.daddr.a4);
NIPQUAD(x->props.saddr.a4),
NIPQUAD(x->id.daddr.a4));
break; break;
case AF_INET6: case AF_INET6:
audit_log_format(audit_buf, " src=%pI6 dst=%pI6", audit_log_format(audit_buf, " src=%pI6 dst=%pI6",
...@@ -2132,10 +2130,8 @@ static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family, ...@@ -2132,10 +2130,8 @@ static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family,
switch (family) { switch (family) {
case AF_INET: case AF_INET:
iph4 = ip_hdr(skb); iph4 = ip_hdr(skb);
audit_log_format(audit_buf, audit_log_format(audit_buf, " src=%pI4 dst=%pI4",
" src=" NIPQUAD_FMT " dst=" NIPQUAD_FMT, &iph4->saddr, &iph4->daddr);
NIPQUAD(iph4->saddr),
NIPQUAD(iph4->daddr));
break; break;
case AF_INET6: case AF_INET6:
iph6 = ipv6_hdr(skb); iph6 = ipv6_hdr(skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册