Commit 46b86a2d authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

[NET]: Use NIP6_FMT in kernel.h

There are errors and inconsistency in the display of NIP6 strings.
	ie: net/ipv6/ip6_flowlabel.c

There are errors and inconsistency in the display of NIPQUAD strings too.
	ie: net/netfilter/nf_conntrack_ftp.c

This patch:
	adds NIP6_FMT to kernel.h
	changes all code to use NIP6_FMT
	fixes net/ipv6/ip6_flowlabel.c
	adds NIPQUAD_FMT to kernel.h
	fixes net/netfilter/nf_conntrack_ftp.c
	changes a few uses of "%u.%u.%u.%u" to NIPQUAD_FMT for symmetry to NIP6_FMT
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23b0ca5b
...@@ -216,6 +216,7 @@ extern void dump_stack(void); ...@@ -216,6 +216,7 @@ extern void dump_stack(void);
((unsigned char *)&addr)[1], \ ((unsigned char *)&addr)[1], \
((unsigned char *)&addr)[2], \ ((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[3] ((unsigned char *)&addr)[3]
#define NIPQUAD_FMT "%u.%u.%u.%u"
#define NIP6(addr) \ #define NIP6(addr) \
ntohs((addr).s6_addr16[0]), \ ntohs((addr).s6_addr16[0]), \
...@@ -226,6 +227,7 @@ extern void dump_stack(void); ...@@ -226,6 +227,7 @@ extern void dump_stack(void);
ntohs((addr).s6_addr16[5]), \ ntohs((addr).s6_addr16[5]), \
ntohs((addr).s6_addr16[6]), \ ntohs((addr).s6_addr16[6]), \
ntohs((addr).s6_addr16[7]) ntohs((addr).s6_addr16[7])
#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
#if defined(__LITTLE_ENDIAN) #if defined(__LITTLE_ENDIAN)
#define HIPQUAD(addr) \ #define HIPQUAD(addr) \
......
...@@ -111,7 +111,7 @@ struct nf_conntrack_tuple ...@@ -111,7 +111,7 @@ struct nf_conntrack_tuple
#ifdef __KERNEL__ #ifdef __KERNEL__
#define NF_CT_DUMP_TUPLE(tp) \ #define NF_CT_DUMP_TUPLE(tp) \
DEBUGP("tuple %p: %u %u %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x %hu -> %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x %hu\n", \ DEBUGP("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \
(tp), (tp)->src.l3num, (tp)->dst.protonum, \ (tp), (tp)->src.l3num, (tp)->dst.protonum, \
NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \ NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \
NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all)) NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all))
......
...@@ -225,13 +225,13 @@ extern int sctp_debug_flag; ...@@ -225,13 +225,13 @@ extern int sctp_debug_flag;
if (sctp_debug_flag) { \ if (sctp_debug_flag) { \
if (saddr->sa.sa_family == AF_INET6) { \ if (saddr->sa.sa_family == AF_INET6) { \
printk(KERN_DEBUG \ printk(KERN_DEBUG \
lead "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" trail, \ lead NIP6_FMT trail, \
leadparm, \ leadparm, \
NIP6(saddr->v6.sin6_addr), \ NIP6(saddr->v6.sin6_addr), \
otherparms); \ otherparms); \
} else { \ } else { \
printk(KERN_DEBUG \ printk(KERN_DEBUG \
lead "%u.%u.%u.%u" trail, \ lead NIPQUAD_FMT trail, \
leadparm, \ leadparm, \
NIPQUAD(saddr->v4.sin_addr.s_addr), \ NIPQUAD(saddr->v4.sin_addr.s_addr), \
otherparms); \ otherparms); \
......
...@@ -2644,7 +2644,7 @@ static int if6_seq_show(struct seq_file *seq, void *v) ...@@ -2644,7 +2644,7 @@ static int if6_seq_show(struct seq_file *seq, void *v)
{ {
struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v; struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v;
seq_printf(seq, seq_printf(seq,
"%04x%04x%04x%04x%04x%04x%04x%04x %02x %02x %02x %02x %8s\n", NIP6_FMT " %02x %02x %02x %02x %8s\n",
NIP6(ifp->addr), NIP6(ifp->addr),
ifp->idev->dev->ifindex, ifp->idev->dev->ifindex,
ifp->prefix_len, ifp->prefix_len,
......
...@@ -332,8 +332,7 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -332,8 +332,7 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (!x) if (!x)
return; return;
NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/" NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/" NIP6_FMT "\n",
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
ntohl(ah->spi), NIP6(iph->daddr)); ntohl(ah->spi), NIP6(iph->daddr));
xfrm_state_put(x); xfrm_state_put(x);
......
...@@ -532,9 +532,7 @@ static int ac6_seq_show(struct seq_file *seq, void *v) ...@@ -532,9 +532,7 @@ static int ac6_seq_show(struct seq_file *seq, void *v)
struct ac6_iter_state *state = ac6_seq_private(seq); struct ac6_iter_state *state = ac6_seq_private(seq);
seq_printf(seq, seq_printf(seq,
"%-4d %-15s " "%-4d %-15s " NIP6_FMT " %5d\n",
"%04x%04x%04x%04x%04x%04x%04x%04x "
"%5d\n",
state->dev->ifindex, state->dev->name, state->dev->ifindex, state->dev->name,
NIP6(im->aca_addr), NIP6(im->aca_addr),
im->aca_users); im->aca_users);
......
...@@ -266,8 +266,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -266,8 +266,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET6); x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET6);
if (!x) if (!x)
return; return;
printk(KERN_DEBUG "pmtu discovery on SA ESP/%08x/" printk(KERN_DEBUG "pmtu discovery on SA ESP/%08x/" NIP6_FMT "\n",
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
ntohl(esph->spi), NIP6(iph->daddr)); ntohl(esph->spi), NIP6(iph->daddr));
xfrm_state_put(x); xfrm_state_put(x);
} }
......
...@@ -607,7 +607,7 @@ static int icmpv6_rcv(struct sk_buff **pskb) ...@@ -607,7 +607,7 @@ static int icmpv6_rcv(struct sk_buff **pskb)
skb->csum = ~csum_ipv6_magic(saddr, daddr, skb->len, skb->csum = ~csum_ipv6_magic(saddr, daddr, skb->len,
IPPROTO_ICMPV6, 0); IPPROTO_ICMPV6, 0);
if (__skb_checksum_complete(skb)) { if (__skb_checksum_complete(skb)) {
LIMIT_NETDEBUG(KERN_DEBUG "ICMPv6 checksum failed [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x > %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]\n", LIMIT_NETDEBUG(KERN_DEBUG "ICMPv6 checksum failed [" NIP6_FMT " > " NIP6_FMT "]\n",
NIP6(*saddr), NIP6(*daddr)); NIP6(*saddr), NIP6(*daddr));
goto discard_it; goto discard_it;
} }
......
...@@ -629,9 +629,7 @@ static void ip6fl_fl_seq_show(struct seq_file *seq, struct ip6_flowlabel *fl) ...@@ -629,9 +629,7 @@ static void ip6fl_fl_seq_show(struct seq_file *seq, struct ip6_flowlabel *fl)
{ {
while(fl) { while(fl) {
seq_printf(seq, seq_printf(seq,
"%05X %-1d %-6d %-6d %-6ld %-8ld " "%05X %-1d %-6d %-6d %-6ld %-8ld " NIP6_FMT " %-4d\n",
"%02x%02x%02x%02x%02x%02x%02x%02x "
"%-4d\n",
(unsigned)ntohl(fl->label), (unsigned)ntohl(fl->label),
fl->share, fl->share,
(unsigned)fl->owner, (unsigned)fl->owner,
...@@ -647,8 +645,8 @@ static void ip6fl_fl_seq_show(struct seq_file *seq, struct ip6_flowlabel *fl) ...@@ -647,8 +645,8 @@ static void ip6fl_fl_seq_show(struct seq_file *seq, struct ip6_flowlabel *fl)
static int ip6fl_seq_show(struct seq_file *seq, void *v) static int ip6fl_seq_show(struct seq_file *seq, void *v)
{ {
if (v == SEQ_START_TOKEN) if (v == SEQ_START_TOKEN)
seq_puts(seq, "Label S Owner Users Linger Expires " seq_printf(seq, "%-5s %-1s %-6s %-6s %-6s %-8s %-39s %s\n",
"Dst Opt\n"); "Label", "S", "Owner", "Users", "Linger", "Expires", "Dst", "Opt");
else else
ip6fl_fl_seq_show(seq, v); ip6fl_fl_seq_show(seq, v);
return 0; return 0;
......
...@@ -212,8 +212,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -212,8 +212,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (!x) if (!x)
return; return;
printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/" printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/" NIP6_FMT "\n",
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
spi, NIP6(iph->daddr)); spi, NIP6(iph->daddr));
xfrm_state_put(x); xfrm_state_put(x);
} }
......
...@@ -2373,7 +2373,7 @@ static int igmp6_mc_seq_show(struct seq_file *seq, void *v) ...@@ -2373,7 +2373,7 @@ static int igmp6_mc_seq_show(struct seq_file *seq, void *v)
struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq); struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq);
seq_printf(seq, seq_printf(seq,
"%-4d %-15s %04x%04x%04x%04x%04x%04x%04x%04x %5d %08X %ld\n", "%-4d %-15s " NIP6_FMT " %5d %08X %ld\n",
state->dev->ifindex, state->dev->name, state->dev->ifindex, state->dev->name,
NIP6(im->mca_addr), NIP6(im->mca_addr),
im->mca_users, im->mca_flags, im->mca_users, im->mca_flags,
...@@ -2542,15 +2542,12 @@ static int igmp6_mcf_seq_show(struct seq_file *seq, void *v) ...@@ -2542,15 +2542,12 @@ static int igmp6_mcf_seq_show(struct seq_file *seq, void *v)
if (v == SEQ_START_TOKEN) { if (v == SEQ_START_TOKEN) {
seq_printf(seq, seq_printf(seq,
"%3s %6s " "%3s %6s "
"%32s %32s %6s %6s\n", "Idx", "%39s %39s %6s %6s\n", "Idx",
"Device", "Multicast Address", "Device", "Multicast Address",
"Source Address", "INC", "EXC"); "Source Address", "INC", "EXC");
} else { } else {
seq_printf(seq, seq_printf(seq,
"%3d %6.6s " "%3d %6.6s " NIP6_FMT " " NIP6_FMT " %6lu %6lu\n",
"%04x%04x%04x%04x%04x%04x%04x%04x "
"%04x%04x%04x%04x%04x%04x%04x%04x "
"%6lu %6lu\n",
state->dev->ifindex, state->dev->name, state->dev->ifindex, state->dev->name,
NIP6(state->im->mca_addr), NIP6(state->im->mca_addr),
NIP6(psf->sf_addr), NIP6(psf->sf_addr),
......
...@@ -692,7 +692,7 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb) ...@@ -692,7 +692,7 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
if (!(neigh->nud_state & NUD_VALID)) { if (!(neigh->nud_state & NUD_VALID)) {
ND_PRINTK1(KERN_DEBUG ND_PRINTK1(KERN_DEBUG
"%s(): trying to ucast probe in NUD_INVALID: " "%s(): trying to ucast probe in NUD_INVALID: "
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", NIP6_FMT "\n",
__FUNCTION__, __FUNCTION__,
NIP6(*target)); NIP6(*target));
} }
......
...@@ -63,9 +63,8 @@ static void dump_packet(const struct nf_loginfo *info, ...@@ -63,9 +63,8 @@ static void dump_packet(const struct nf_loginfo *info,
return; return;
} }
/* Max length: 88 "SRC=0000.0000.0000.0000.0000.0000.0000.0000 DST=0000.0000.0000.0000.0000.0000.0000.0000" */ /* Max length: 88 "SRC=0000.0000.0000.0000.0000.0000.0000.0000 DST=0000.0000.0000.0000.0000.0000.0000.0000 " */
printk("SRC=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(ih->saddr)); printk("SRC=" NIP6_FMT " DST=" NIP6_FMT " ", NIP6(ih->saddr), NIP6(ih->daddr));
printk("DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(ih->daddr));
/* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */ /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */
printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ", printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ",
......
...@@ -74,7 +74,7 @@ static int ipv6_invert_tuple(struct nf_conntrack_tuple *tuple, ...@@ -74,7 +74,7 @@ static int ipv6_invert_tuple(struct nf_conntrack_tuple *tuple,
static int ipv6_print_tuple(struct seq_file *s, static int ipv6_print_tuple(struct seq_file *s,
const struct nf_conntrack_tuple *tuple) const struct nf_conntrack_tuple *tuple)
{ {
return seq_printf(s, "src=%x:%x:%x:%x:%x:%x:%x:%x dst=%x:%x:%x:%x:%x:%x:%x:%x ", return seq_printf(s, "src=" NIP6_FMT " dst=" NIP6_FMT " ",
NIP6(*((struct in6_addr *)tuple->src.u3.ip6)), NIP6(*((struct in6_addr *)tuple->src.u3.ip6)),
NIP6(*((struct in6_addr *)tuple->dst.u3.ip6))); NIP6(*((struct in6_addr *)tuple->dst.u3.ip6)));
} }
......
...@@ -259,8 +259,7 @@ try_next_2:; ...@@ -259,8 +259,7 @@ try_next_2:;
spi = 0; spi = 0;
goto out; goto out;
alloc_spi: alloc_spi:
X6TPRINTK3(KERN_DEBUG "%s(): allocate new spi for " X6TPRINTK3(KERN_DEBUG "%s(): allocate new spi for " NIP6_FMT "\n",
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
__FUNCTION__, __FUNCTION__,
NIP6(*(struct in6_addr *)saddr)); NIP6(*(struct in6_addr *)saddr));
x6spi = kmem_cache_alloc(xfrm6_tunnel_spi_kmem, SLAB_ATOMIC); x6spi = kmem_cache_alloc(xfrm6_tunnel_spi_kmem, SLAB_ATOMIC);
...@@ -323,9 +322,8 @@ void xfrm6_tunnel_free_spi(xfrm_address_t *saddr) ...@@ -323,9 +322,8 @@ void xfrm6_tunnel_free_spi(xfrm_address_t *saddr)
list_byaddr) list_byaddr)
{ {
if (memcmp(&x6spi->addr, saddr, sizeof(x6spi->addr)) == 0) { if (memcmp(&x6spi->addr, saddr, sizeof(x6spi->addr)) == 0) {
X6TPRINTK3(KERN_DEBUG "%s(): x6spi object " X6TPRINTK3(KERN_DEBUG "%s(): x6spi object for " NIP6_FMT
"for %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " " found at %p\n",
"found at %p\n",
__FUNCTION__, __FUNCTION__,
NIP6(*(struct in6_addr *)saddr), NIP6(*(struct in6_addr *)saddr),
x6spi); x6spi);
......
...@@ -545,11 +545,11 @@ static int help(struct sk_buff **pskb, ...@@ -545,11 +545,11 @@ static int help(struct sk_buff **pskb,
different IP address. Simply don't record it for different IP address. Simply don't record it for
NAT. */ NAT. */
if (cmd.l3num == PF_INET) { if (cmd.l3num == PF_INET) {
DEBUGP("conntrack_ftp: NOT RECORDING: %u,%u,%u,%u != %u.%u.%u.%u\n", DEBUGP("conntrack_ftp: NOT RECORDING: " NIPQUAD_FMT " != " NIPQUAD_FMT "\n",
NIPQUAD(cmd.u3.ip), NIPQUAD(cmd.u3.ip),
NIPQUAD(ct->tuplehash[dir].tuple.src.u3.ip)); NIPQUAD(ct->tuplehash[dir].tuple.src.u3.ip));
} else { } else {
DEBUGP("conntrack_ftp: NOT RECORDING: %x:%x:%x:%x:%x:%x:%x:%x != %x:%x:%x:%x:%x:%x:%x:%x\n", DEBUGP("conntrack_ftp: NOT RECORDING: " NIP6_FMT " != " NIP6_FMT "\n",
NIP6(*((struct in6_addr *)cmd.u3.ip6)), NIP6(*((struct in6_addr *)cmd.u3.ip6)),
NIP6(*((struct in6_addr *)ct->tuplehash[dir] NIP6(*((struct in6_addr *)ct->tuplehash[dir]
.tuple.src.u3.ip6))); .tuple.src.u3.ip6)));
......
...@@ -180,8 +180,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, ...@@ -180,8 +180,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
} }
SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, "
"src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " "src:" NIP6_FMT " dst:" NIP6_FMT "\n",
"dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
__FUNCTION__, skb, skb->len, __FUNCTION__, skb, skb->len,
NIP6(fl.fl6_src), NIP6(fl.fl6_dst)); NIP6(fl.fl6_src), NIP6(fl.fl6_dst));
...@@ -206,13 +205,13 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc, ...@@ -206,13 +205,13 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
fl.oif = daddr->v6.sin6_scope_id; fl.oif = daddr->v6.sin6_scope_id;
SCTP_DEBUG_PRINTK("%s: DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ",
__FUNCTION__, NIP6(fl.fl6_dst)); __FUNCTION__, NIP6(fl.fl6_dst));
if (saddr) { if (saddr) {
ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr); ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr);
SCTP_DEBUG_PRINTK( SCTP_DEBUG_PRINTK(
"SRC=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x - ", "SRC=" NIP6_FMT " - ",
NIP6(fl.fl6_src)); NIP6(fl.fl6_src));
} }
...@@ -221,8 +220,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc, ...@@ -221,8 +220,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
struct rt6_info *rt; struct rt6_info *rt;
rt = (struct rt6_info *)dst; rt = (struct rt6_info *)dst;
SCTP_DEBUG_PRINTK( SCTP_DEBUG_PRINTK(
"rt6_dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " "rt6_dst:" NIP6_FMT " rt6_src:" NIP6_FMT "\n",
"rt6_src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
NIP6(rt->rt6i_dst.addr), NIP6(rt->rt6i_src.addr)); NIP6(rt->rt6i_dst.addr), NIP6(rt->rt6i_src.addr));
} else { } else {
SCTP_DEBUG_PRINTK("NO ROUTE\n"); SCTP_DEBUG_PRINTK("NO ROUTE\n");
...@@ -271,13 +269,12 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc, ...@@ -271,13 +269,12 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
__u8 bmatchlen; __u8 bmatchlen;
SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p " SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p "
"daddr:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", "daddr:" NIP6_FMT " ",
__FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr)); __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr));
if (!asoc) { if (!asoc) {
ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr); ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr);
SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n",
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
NIP6(saddr->v6.sin6_addr)); NIP6(saddr->v6.sin6_addr));
return; return;
} }
...@@ -305,13 +302,11 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc, ...@@ -305,13 +302,11 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
if (baddr) { if (baddr) {
memcpy(saddr, baddr, sizeof(union sctp_addr)); memcpy(saddr, baddr, sizeof(union sctp_addr));
SCTP_DEBUG_PRINTK("saddr: " SCTP_DEBUG_PRINTK("saddr: " NIP6_FMT "\n",
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
NIP6(saddr->v6.sin6_addr)); NIP6(saddr->v6.sin6_addr));
} else { } else {
printk(KERN_ERR "%s: asoc:%p Could not find a valid source " printk(KERN_ERR "%s: asoc:%p Could not find a valid source "
"address for the " "address for the dest:" NIP6_FMT "\n",
"dest:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
__FUNCTION__, asoc, NIP6(daddr->v6.sin6_addr)); __FUNCTION__, asoc, NIP6(daddr->v6.sin6_addr));
} }
...@@ -675,8 +670,7 @@ static int sctp_v6_is_ce(const struct sk_buff *skb) ...@@ -675,8 +670,7 @@ static int sctp_v6_is_ce(const struct sk_buff *skb)
/* Dump the v6 addr to the seq file. */ /* Dump the v6 addr to the seq file. */
static void sctp_v6_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) static void sctp_v6_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
{ {
seq_printf(seq, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", seq_printf(seq, NIP6_FMT " ", NIP6(addr->v6.sin6_addr));
NIP6(addr->v6.sin6_addr));
} }
/* Initialize a PF_INET6 socket msg_name. */ /* Initialize a PF_INET6 socket msg_name. */
......
...@@ -1036,14 +1036,14 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, ...@@ -1036,14 +1036,14 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
if (from_addr.sa.sa_family == AF_INET6) { if (from_addr.sa.sa_family == AF_INET6) {
printk(KERN_WARNING printk(KERN_WARNING
"%s association %p could not find address " "%s association %p could not find address "
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", NIP6_FMT "\n",
__FUNCTION__, __FUNCTION__,
asoc, asoc,
NIP6(from_addr.v6.sin6_addr)); NIP6(from_addr.v6.sin6_addr));
} else { } else {
printk(KERN_WARNING printk(KERN_WARNING
"%s association %p could not find address " "%s association %p could not find address "
"%u.%u.%u.%u\n", NIPQUAD_FMT "\n",
__FUNCTION__, __FUNCTION__,
asoc, asoc,
NIPQUAD(from_addr.v4.sin_addr.s_addr)); NIPQUAD(from_addr.v4.sin_addr.s_addr));
......
...@@ -494,8 +494,7 @@ static inline void avc_print_ipv6_addr(struct audit_buffer *ab, ...@@ -494,8 +494,7 @@ static inline void avc_print_ipv6_addr(struct audit_buffer *ab,
char *name1, char *name2) char *name1, char *name2)
{ {
if (!ipv6_addr_any(addr)) if (!ipv6_addr_any(addr))
audit_log_format(ab, " %s=%04x:%04x:%04x:%04x:%04x:" audit_log_format(ab, " %s=" NIP6_FMT, name1, NIP6(*addr));
"%04x:%04x:%04x", name1, NIP6(*addr));
if (port) if (port)
audit_log_format(ab, " %s=%d", name2, ntohs(port)); audit_log_format(ab, " %s=%d", name2, ntohs(port));
} }
...@@ -504,7 +503,7 @@ static inline void avc_print_ipv4_addr(struct audit_buffer *ab, u32 addr, ...@@ -504,7 +503,7 @@ static inline void avc_print_ipv4_addr(struct audit_buffer *ab, u32 addr,
__be16 port, char *name1, char *name2) __be16 port, char *name1, char *name2)
{ {
if (addr) if (addr)
audit_log_format(ab, " %s=%d.%d.%d.%d", name1, NIPQUAD(addr)); audit_log_format(ab, " %s=" NIPQUAD_FMT, name1, NIPQUAD(addr));
if (port) if (port)
audit_log_format(ab, " %s=%d", name2, ntohs(port)); audit_log_format(ab, " %s=%d", name2, ntohs(port));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment