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

[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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -216,6 +216,7 @@ extern void dump_stack(void);
	((unsigned char *)&addr)[1], \
	((unsigned char *)&addr)[2], \
	((unsigned char *)&addr)[3]
#define NIPQUAD_FMT "%u.%u.%u.%u"

#define NIP6(addr) \
	ntohs((addr).s6_addr16[0]), \
@@ -226,6 +227,7 @@ extern void dump_stack(void);
	ntohs((addr).s6_addr16[5]), \
	ntohs((addr).s6_addr16[6]), \
	ntohs((addr).s6_addr16[7])
#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"

#if defined(__LITTLE_ENDIAN)
#define HIPQUAD(addr) \
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ struct nf_conntrack_tuple
#ifdef __KERNEL__

#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,			    \
	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))
+2 −2
Original line number Diff line number Diff line
@@ -225,13 +225,13 @@ extern int sctp_debug_flag;
	if (sctp_debug_flag) { \
		if (saddr->sa.sa_family == AF_INET6) { \
			printk(KERN_DEBUG \
			       lead "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" trail, \
			       lead NIP6_FMT trail, \
			       leadparm, \
			       NIP6(saddr->v6.sin6_addr), \
			       otherparms); \
		} else { \
			printk(KERN_DEBUG \
			       lead "%u.%u.%u.%u" trail, \
			       lead NIPQUAD_FMT trail, \
			       leadparm, \
			       NIPQUAD(saddr->v4.sin_addr.s_addr), \
			       otherparms); \
+1 −1
Original line number Diff line number Diff line
@@ -2644,7 +2644,7 @@ static int if6_seq_show(struct seq_file *seq, void *v)
{
	struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v;
	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),
		   ifp->idev->dev->ifindex,
		   ifp->prefix_len,
+1 −2
Original line number Diff line number Diff line
@@ -332,8 +332,7 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
	if (!x)
		return;

	NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/"
		 "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
	NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/" NIP6_FMT "\n",
		 ntohl(ah->spi), NIP6(iph->daddr));

	xfrm_state_put(x);
Loading