Skip to contentSkip to conversation

Remove most uses of NIPQUAD and NIPQUAD_FMT

PATCH Applied Joe Perches 7 participants 24 messages Jan 6, 2010 – Jan 15, 2010

Subsystems (12)
lore
Share & tools
lore
#0 lore raw

cover Remove most uses of NIPQUAD and NIPQUAD_FMT

Convert them to the %pI4 format extension where possible Only a couple uses are left in netfilter.

Joe Perches (8):
drivers/scsi: Remove uses of NIPQUAD, use %pI4 drivers/staging/pohmelfs/inode.c: Remove uses of NIPQUAD, use %pI4 net/rds: Remove uses of NIPQUAD, use %pI4
net/sunrpc: Remove uses of NIPQUAD, use %pI4 net/ipv4/netfilter/nf_nat_ftp.c: Convert NIPQUAD to %pI4 net/netfilter/ipvs/ip_vs_ftp.c: Use standardized format in sprintf fs/ocfs2/cluster/tcp.c: Remove use of NIPQUAD, use %pI4 drivers/firmware/iscsi_ibft.c: Remove NIPQUAD_FMT, use %pI4

 drivers/firmware/iscsi_ibft.c        |    8 +++-----
 drivers/scsi/bnx2i/bnx2i_iscsi.c     |    4 ++--
 drivers/scsi/cxgb3i/cxgb3i_iscsi.c   |    5 ++---
 drivers/scsi/cxgb3i/cxgb3i_offload.c |    7 ++++---
 drivers/staging/pohmelfs/inode.c     |    3 +--
 fs/ocfs2/cluster/tcp.c               |    4 ++--
 net/ipv4/netfilter/nf_nat_ftp.c      |    2 +-
 net/netfilter/ipvs/ip_vs_ftp.c       |    2 +-
 net/rds/tcp_connect.c                |    7 +++----
 net/rds/tcp_listen.c                 |    6 +++---
 net/rds/tcp_send.c                   |    4 ++--
 net/sunrpc/xprtrdma/transport.c      |    3 +--
 net/sunrpc/xprtsock.c                |    5 ++---
 13 files changed, 27 insertions(+), 33 deletions(-)
#1 lore raw

PATCH 1/8 drivers/scsi: Remove uses of NIPQUAD, use %pI4

---
 drivers/scsi/bnx2i/bnx2i_iscsi.c     |    4 ++--
 drivers/scsi/cxgb3i/cxgb3i_iscsi.c   |    5 ++---
 drivers/scsi/cxgb3i/cxgb3i_offload.c |    7 ++++---
 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/scsi/bnx2i/bnx2i_iscsi.c +2 -2
index 33b2294..51709cb 100644
@@ -1426,8 +1426,8 @@ static int bnx2i_conn_get_param(struct iscsi_cls_conn *cls_conn,
 		break;
 	case ISCSI_PARAM_CONN_ADDRESS:
 		if (bnx2i_conn->ep)
-			len = sprintf(buf, NIPQUAD_FMT "\n",
-				      NIPQUAD(bnx2i_conn->ep->cm_sk->dst_ip));
+			len = sprintf(buf, "%pI4\n",
+				      &bnx2i_conn->ep->cm_sk->dst_ip);
 		break;
 	default:
 		return iscsi_conn_get_param(cls_conn, param, buf);
drivers/scsi/cxgb3i/cxgb3i_iscsi.c +2 -3
index 969c831..1fd89b2 100644
@@ -591,8 +591,7 @@ static int cxgb3i_conn_bind(struct iscsi_cls_session *cls_session,
 	cxgb3i_conn_max_recv_dlength(conn);
 
 	spin_lock_bh(&conn->session->lock);
-	sprintf(conn->portal_address, NIPQUAD_FMT,
-		NIPQUAD(c3cn->daddr.sin_addr.s_addr));
+	sprintf(conn->portal_address, "%pI4", &c3cn->daddr.sin_addr.s_addr);
 	conn->portal_port = ntohs(c3cn->daddr.sin_port);
 	spin_unlock_bh(&conn->session->lock);
 
@@ -753,7 +752,7 @@ static int cxgb3i_host_get_param(struct Scsi_Host *shost,
 		__be32 addr;
 
 		addr = cxgb3i_get_private_ipv4addr(hba->ndev);
-		len = sprintf(buf, NIPQUAD_FMT, NIPQUAD(addr));
+		len = sprintf(buf, "%pI4", &addr);
 		break;
 	}
 	default:
drivers/scsi/cxgb3i/cxgb3i_offload.c +4 -3
index 26ffdcd..edef61c 100644
@@ -1643,10 +1643,11 @@ int cxgb3i_c3cn_connect(struct net_device *dev, struct s3_conn *c3cn,
 	} else
 		c3cn->saddr.sin_addr.s_addr = sipv4;
 
-	c3cn_conn_debug("c3cn 0x%p, %u.%u.%u.%u,%u-%u.%u.%u.%u,%u SYN_SENT.\n",
-			c3cn, NIPQUAD(c3cn->saddr.sin_addr.s_addr),
+	c3cn_conn_debug("c3cn 0x%p, %pI4,%u-%pI4,%u SYN_SENT.\n",
+			c3cn,
+			&c3cn->saddr.sin_addr.s_addr,
 			ntohs(c3cn->saddr.sin_port),
-			NIPQUAD(c3cn->daddr.sin_addr.s_addr),
+			&c3cn->daddr.sin_addr.s_addr,
 			ntohs(c3cn->daddr.sin_port));
 
 	c3cn_set_state(c3cn, C3CN_STATE_CONNECTING);
Signature · 1 line
1.6.6.rc0.57.gad7a
#3 lore raw

PATCH 3/8 net/rds: Remove uses of NIPQUAD, use %pI4

In reply to Joe Perches
---
 net/rds/tcp_connect.c |    7 +++----
 net/rds/tcp_listen.c  |    6 +++---
 net/rds/tcp_send.c    |    4 ++--
 3 files changed, 8 insertions(+), 9 deletions(-)
net/rds/tcp_connect.c +3 -4
index 211522f..0562562 100644
@@ -90,8 +90,8 @@ int rds_tcp_conn_connect(struct rds_connection *conn)
 
 	ret = sock->ops->bind(sock, (struct sockaddr *)&src, sizeof(src));
 	if (ret) {
-		rdsdebug("bind failed with %d at address %u.%u.%u.%u\n",
-		     ret, NIPQUAD(conn->c_laddr));
+		rdsdebug("bind failed with %d at address %pI4\n",
+			 ret, &conn->c_laddr);
 		goto out;
 	}
 
@@ -108,8 +108,7 @@ int rds_tcp_conn_connect(struct rds_connection *conn)
 				 O_NONBLOCK);
 	sock = NULL;
 
-	rdsdebug("connect to address %u.%u.%u.%u returned %d\n",
-		 NIPQUAD(conn->c_faddr), ret);
+	rdsdebug("connect to address %pI4 returned %d\n", &conn->c_faddr, ret);
 	if (ret == -EINPROGRESS)
 		ret = 0;
 
net/rds/tcp_listen.c +3 -3
index 45474a4..53cb1b5 100644
@@ -66,9 +66,9 @@ static int rds_tcp_accept_one(struct socket *sock)
 
 	inet = inet_sk(new_sock->sk);
 
-	rdsdebug("accepted tcp %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n",
-		  NIPQUAD(inet->inet_saddr), ntohs(inet->inet_sport),
-		  NIPQUAD(inet->inet_daddr), ntohs(inet->inet_dport));
+	rdsdebug("accepted tcp %pI4:%u -> %pI4:%u\n",
+		 &inet->inet_saddr, ntohs(inet->inet_sport),
+		 &inet->inet_daddr, ntohs(inet->inet_dport));
 
 	conn = rds_conn_create(inet->inet_saddr, inet->inet_daddr,
 			       &rds_tcp_transport, GFP_KERNEL);
net/rds/tcp_send.c +2 -2
index ab545e0..34fdcc0 100644
@@ -193,9 +193,9 @@ out:
 			rds_tcp_stats_inc(s_tcp_sndbuf_full);
 			ret = 0;
 		} else {
-			printk(KERN_WARNING "RDS/tcp: send to %u.%u.%u.%u "
+			printk(KERN_WARNING "RDS/tcp: send to %pI4 "
 			       "returned %d, disconnecting and reconnecting\n",
-			       NIPQUAD(conn->c_faddr), ret);
+			       &conn->c_faddr, ret);
 			rds_conn_drop(conn);
 		}
 	}
Signature · 1 line
1.6.6.rc0.57.gad7a
#4 lore raw

PATCH 4/8 net/sunrpc: Remove uses of NIPQUAD, use %pI4

In reply to Joe Perches
---
 net/sunrpc/xprtrdma/transport.c |    3 +--
 net/sunrpc/xprtsock.c           |    5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)
net/sunrpc/xprtrdma/transport.c +1 -2
index 7018eef..83d339f 100644
@@ -165,8 +165,7 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
 
 	xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma";
 
-	(void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x",
-				NIPQUAD(sin->sin_addr.s_addr));
+	(void)snprintf(buf, sizeof(buf), "%08x", ntohl(sin->sin_addr.s_addr));
 	xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL);
 
 	(void)snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap));
net/sunrpc/xprtsock.c +2 -3
index 3d739e5..86234bc 100644
@@ -297,12 +297,11 @@ static void xs_format_common_peer_addresses(struct rpc_xprt *xprt)
 	switch (sap->sa_family) {
 	case AF_INET:
 		sin = xs_addr_in(xprt);
-		(void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x",
-					NIPQUAD(sin->sin_addr.s_addr));
+		snprintf(buf, sizeof(buf), "%08x", ntohl(sin->sin_addr.s_addr));
 		break;
 	case AF_INET6:
 		sin6 = xs_addr_in6(xprt);
-		(void)snprintf(buf, sizeof(buf), "%pi6", &sin6->sin6_addr);
+		snprintf(buf, sizeof(buf), "%pi6", &sin6->sin6_addr);
 		break;
 	default:
 		BUG();
Signature · 6 lines
1.6.6.rc0.57.gad7a

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH 5/8 net/ipv4/netfilter/nf_nat_ftp.c: Convert NIPQUAD to %pI4

In reply to Joe Perches
---
 net/ipv4/netfilter/nf_nat_ftp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/netfilter/nf_nat_ftp.c +1 -1
index a1d5d58..d1c5afc 100644
@@ -59,7 +59,7 @@ mangle_eprt_packet(struct sk_buff *skb,
 {
 	char buffer[sizeof("|1|255.255.255.255|65535|")];
 
-	sprintf(buffer, "|1|%u.%u.%u.%u|%u|", NIPQUAD(newip), port);
+	sprintf(buffer, "|1|%pI4|%u|", &newip, port);
 
 	pr_debug("calling nf_nat_mangle_tcp_packet\n");
 
Signature · 1 line
1.6.6.rc0.57.gad7a
#18 lore raw

PATCH 6/8 net/netfilter/ipvs/ip_vs_ftp.c: Use standardized format in sprintf

In reply to Joe Perches

Use the same format string as net/ipv4/netfilter/nf_nat_ftp.c to encode an ipv4 address and port.

Both uses should be a single common function.

---
 net/netfilter/ipvs/ip_vs_ftp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netfilter/ipvs/ip_vs_ftp.c +1 -1
index 33e2c79..73f38ea 100644
@@ -208,7 +208,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
 		 */
 		from.ip = n_cp->vaddr.ip;
 		port = n_cp->vport;
-		sprintf(buf, "%d,%d,%d,%d,%d,%d", NIPQUAD(from.ip),
+		sprintf(buf, "%u,%u,%u,%u,%u,%u", NIPQUAD(from.ip),
 			(ntohs(port)>>8)&255, ntohs(port)&255);
 		buf_len = strlen(buf);
 
Signature · 1 line
1.6.6.rc0.57.gad7a
#21 lore raw

PATCH 7/8 fs/ocfs2/cluster/tcp.c: Remove use of NIPQUAD, use %pI4

In reply to Joe Perches
---
 fs/ocfs2/cluster/tcp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/cluster/tcp.c +2 -2
index 334f231..7a9620e 100644
@@ -72,9 +72,9 @@
 
 #include "tcp_internal.h"
 
-#define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u"
+#define SC_NODEF_FMT "node %s (num %u) at %pI4:%u"
 #define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num,	\
-			  NIPQUAD(sc->sc_node->nd_ipv4_address),	\
+			  &sc->sc_node->nd_ipv4_address,		\
 			  ntohs(sc->sc_node->nd_ipv4_port)
 
 /*
Signature · 1 line
1.6.6.rc0.57.gad7a
#23 lore raw

PATCH 8/8 drivers/firmware/iscsi_ibft.c: Remove NIPQUAD_FMT, use %pI4

In reply to Joe Perches

Convert netmask to __be32 and format it with %pI4

---
 drivers/firmware/iscsi_ibft.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/firmware/iscsi_ibft.c +3 -5
index 051d1eb..f82bcda 100644
@@ -381,7 +381,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 	void *ibft_loc = entry->header;
 	char *str = buf;
 	char *mac;
-	int val;
+	__be32 val;
 
 	if (!nic)
 		return 0;
@@ -397,10 +397,8 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 		str += sprintf_ipaddr(str, nic->ip_addr);
 		break;
 	case ibft_eth_subnet_mask:
-		val = ~((1 << (32-nic->subnet_mask_prefix))-1);
-		str += sprintf(str, NIPQUAD_FMT,
-			       (u8)(val >> 24), (u8)(val >> 16),
-			       (u8)(val >> 8), (u8)(val));
+		val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
+		str += sprintf(str, "%pI4", &val);
 		break;
 	case ibft_eth_origin:
 		str += sprintf(str, "%d\n", nic->origin);
Signature · 1 line
1.6.6.rc0.57.gad7a
#2 lore raw

PATCH 2/8 drivers/staging/pohmelfs/inode.c: Remove uses of NIPQUAD, use %pI4

In reply to Joe Perches
---
 drivers/staging/pohmelfs/inode.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/staging/pohmelfs/inode.c +1 -2
index f69b778..e286fd1 100644
@@ -1767,8 +1767,7 @@ static int pohmelfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
 		seq_printf(m, "%u ", ctl->idx);
 		if (ctl->addr.sa_family == AF_INET) {
 			struct sockaddr_in *sin = (struct sockaddr_in *)&st->ctl.addr;
-			/* seq_printf(m, "%pi4:%u", &sin->sin_addr.s_addr, ntohs(sin->sin_port)); */
-			seq_printf(m, "%u.%u.%u.%u:%u", NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port));
+			seq_printf(m, "%pI4:%u", &sin->sin_addr.s_addr, ntohs(sin->sin_port));
 		} else if (ctl->addr.sa_family == AF_INET6) {
 			struct sockaddr_in6 *sin = (struct sockaddr_in6 *)&st->ctl.addr;
 			seq_printf(m, "%pi6:%u", &sin->sin6_addr, ntohs(sin->sin6_port));
Signature · 1 line
1.6.6.rc0.57.gad7a
maintainer Acked-by on v1 6/8
#19 lore raw

Re: [PATCH 6/8] net/netfilter/ipvs/ip_vs_ftp.c: Use standardized format in sprintf

In reply to Joe Perches
Quoted 6 lines · Joe Perches

Use the same format string as net/ipv4/netfilter/nf_nat_ftp.c to encode an ipv4 address and port.

Both uses should be a single common function.

Quoted 24 lines
---
 net/netfilter/ipvs/ip_vs_ftp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netfilter/ipvs/ip_vs_ftp.c +1 -1
index 33e2c79..73f38ea 100644
@@ -208,7 +208,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
 		 */
 		from.ip = n_cp->vaddr.ip;
 		port = n_cp->vport;
-		sprintf(buf, "%d,%d,%d,%d,%d,%d", NIPQUAD(from.ip),
+		sprintf(buf, "%u,%u,%u,%u,%u,%u", NIPQUAD(from.ip),
 			(ntohs(port)>>8)&255, ntohs(port)&255);
 		buf_len = strlen(buf);
 
Signature · 6 lines
1.6.6.rc0.57.gad7a

--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH v2 5/8 net/ipv4/netfilter/nf_nat_ftp.c: Remove (*mangle[]) array and functions, use %pI4

In reply to Joe Perches

These functions merely exist to format a buffer and call nf_nat_mangle_tcp_packet.

Format the buffer and perform the call in nf_nat_ftp instead.

Use %pI4 for the IP address.

Saves ~600 bytes of text

old:

$ size net/ipv4/netfilter/nf_nat_ftp.o
   text	   data	    bss	    dec	    hex	filename
   2187	    160	    408	   2755	    ac3	net/ipv4/netfilter/nf_nat_ftp.o
new:
$ size net/ipv4/netfilter/nf_nat_ftp.o
   text    data     bss     dec     hex filename
   1532     112     288    1932     78c net/ipv4/netfilter/nf_nat_ftp.o
 net/ipv4/netfilter/nf_nat_ftp.c |  105 +++++++++++++--------------------------
 1 files changed, 35 insertions(+), 70 deletions(-)
net/ipv4/netfilter/nf_nat_ftp.c +35 -70
index a1d5d58..86e0e84 100644
@@ -27,76 +27,29 @@ MODULE_ALIAS("ip_nat_ftp");
 
 /* FIXME: Time out? --RR */
 
-static int
-mangle_rfc959_packet(struct sk_buff *skb,
-		     __be32 newip,
-		     u_int16_t port,
-		     unsigned int matchoff,
-		     unsigned int matchlen,
-		     struct nf_conn *ct,
-		     enum ip_conntrack_info ctinfo)
+static int nf_nat_ftp_fmt_cmd(enum nf_ct_ftp_type type,
+			      char *buffer, size_t buflen,
+			      __be32 addr, u16 port)
 {
-	char buffer[sizeof("nnn,nnn,nnn,nnn,nnn,nnn")];
-
-	sprintf(buffer, "%u,%u,%u,%u,%u,%u",
-		NIPQUAD(newip), port>>8, port&0xFF);
-
-	pr_debug("calling nf_nat_mangle_tcp_packet\n");
-
-	return nf_nat_mangle_tcp_packet(skb, ct, ctinfo, matchoff,
-					matchlen, buffer, strlen(buffer));
-}
-
-/* |1|132.235.1.2|6275| */
-static int
-mangle_eprt_packet(struct sk_buff *skb,
-		   __be32 newip,
-		   u_int16_t port,
-		   unsigned int matchoff,
-		   unsigned int matchlen,
-		   struct nf_conn *ct,
-		   enum ip_conntrack_info ctinfo)
-{
-	char buffer[sizeof("|1|255.255.255.255|65535|")];
-
-	sprintf(buffer, "|1|%u.%u.%u.%u|%u|", NIPQUAD(newip), port);
-
-	pr_debug("calling nf_nat_mangle_tcp_packet\n");
-
-	return nf_nat_mangle_tcp_packet(skb, ct, ctinfo, matchoff,
-					matchlen, buffer, strlen(buffer));
-}
-
-/* |1|132.235.1.2|6275| */
-static int
-mangle_epsv_packet(struct sk_buff *skb,
-		   __be32 newip,
-		   u_int16_t port,
-		   unsigned int matchoff,
-		   unsigned int matchlen,
-		   struct nf_conn *ct,
-		   enum ip_conntrack_info ctinfo)
-{
-	char buffer[sizeof("|||65535|")];
-
-	sprintf(buffer, "|||%u|", port);
-
-	pr_debug("calling nf_nat_mangle_tcp_packet\n");
+	switch (type) {
+	case NF_CT_FTP_PORT:
+	case NF_CT_FTP_PASV:
+		return snprintf(buffer, buflen, "%u,%u,%u,%u,%u,%u",
+				((unsigned char *)&addr)[0],
+				((unsigned char *)&addr)[1],
+				((unsigned char *)&addr)[2],
+				((unsigned char *)&addr)[3],
+				port >> 8,
+				port & 0xFF);
+	case NF_CT_FTP_EPRT:
+		return snprintf(buffer, buflen, "|1|%pI4|%u|", &addr, port);
+	case NF_CT_FTP_EPSV:
+		return snprintf(buffer, buflen, "|||%u|", port);
+	}
 
-	return nf_nat_mangle_tcp_packet(skb, ct, ctinfo, matchoff,
-					matchlen, buffer, strlen(buffer));
+	return 0;
 }
 
-static int (*mangle[])(struct sk_buff *, __be32, u_int16_t,
-		       unsigned int, unsigned int, struct nf_conn *,
-		       enum ip_conntrack_info)
-= {
-	[NF_CT_FTP_PORT] = mangle_rfc959_packet,
-	[NF_CT_FTP_PASV] = mangle_rfc959_packet,
-	[NF_CT_FTP_EPRT] = mangle_eprt_packet,
-	[NF_CT_FTP_EPSV] = mangle_epsv_packet
-};
-
 /* So, this packet has hit the connection tracking matching code.
    Mangle it, and change the expectation to match the new version. */
 static unsigned int nf_nat_ftp(struct sk_buff *skb,
@@ -110,6 +63,8 @@ static unsigned int nf_nat_ftp(struct sk_buff *skb,
 	u_int16_t port;
 	int dir = CTINFO2DIR(ctinfo);
 	struct nf_conn *ct = exp->master;
+	char buffer[sizeof("|1|255.255.255.255|65535|")];
+	unsigned int buflen;
 
 	pr_debug("FTP_NAT: type %i, off %u len %u\n", type, matchoff, matchlen);
 
@@ -132,11 +87,21 @@ static unsigned int nf_nat_ftp(struct sk_buff *skb,
 	if (port == 0)
 		return NF_DROP;
 
-	if (!mangle[type](skb, newip, port, matchoff, matchlen, ct, ctinfo)) {
-		nf_ct_unexpect_related(exp);
-		return NF_DROP;
-	}
+	buflen = nf_nat_ftp_fmt_cmd(type, buffer, sizeof(buffer), newip, port);
+	if (!buflen)
+		goto out;
+
+	pr_debug("calling nf_nat_mangle_tcp_packet\n");
+
+	if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo, matchoff,
+				      matchlen, buffer, buflen))
+		goto out;
+
 	return NF_ACCEPT;
+
+out:
+	nf_ct_unexpect_related(exp);
+	return NF_DROP;
 }
 
 static void __exit nf_nat_ftp_fini(void)
Acked-by on v1 7/8
#22 lore raw

Re: [PATCH 7/8] fs/ocfs2/cluster/tcp.c: Remove use of NIPQUAD, use %pI4

In reply to Joe Perches
Quoted 1 line · Joe Perches
Signature · 11 lines
The Graham Corollary:

	The longer a socially-moderated news website exists, the
	probability of an old Paul Graham link appearing at the top
	approaches certainty.

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
#7 lore raw

Re: [PATCH v2 5/8] net/ipv4/netfilter/nf_nat_ftp.c: Remove (*mangle[]) array and functions, use %pI4

In reply to Joe Perches
Quoted 9 lines · Joe Perches

These functions merely exist to format a buffer and call nf_nat_mangle_tcp_packet.

Format the buffer and perform the call in nf_nat_ftp instead.

Use %pI4 for the IP address.

Saves ~600 bytes of text

Quoted 8 lines

old:

$ size net/ipv4/netfilter/nf_nat_ftp.o
   text	   data	    bss	    dec	    hex	filename
   2187	    160	    408	   2755	    ac3	net/ipv4/netfilter/nf_nat_ftp.o
new:
$ size net/ipv4/netfilter/nf_nat_ftp.o
   text    data     bss     dec     hex filename
   1532     112     288    1932     78c net/ipv4/netfilter/nf_nat_ftp.o

Applied, thanks. BTW, its enough to CC netfilter-devel and optionally netdev on patches, netfilter and netfilter-core are unnecessary.

#8 lore raw

PATCH 1/1 MAINTAINERS: netfilter - Remove netfilter and netfilter-core lists

In reply to Patrick McHardy
Quoted 2 lines · Patrick McHardy

it's enough to CC netfilter-devel and optionally netdev on patches, netfilter and netfilter-core are unnecessary.

MAINTAINERS +0 -2
index 745643b..860d04f 100644
@@ -3742,8 +3742,6 @@ P:	Harald Welte
 P:	Jozsef Kadlecsik
 M:	Patrick McHardy <[email protected]>
 L:	[email protected]
-L:	[email protected]
-L:	[email protected]
 W:	http://www.netfilter.org/
 W:	http://www.iptables.org/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git
#9 lore raw

Re: [PATCH] MAINTAINERS: netfilter - Remove netfilter and netfilter-core lists

Quoted 11 lines · Joe Perches
Quoted 2 lines · Patrick McHardy

it's enough to CC netfilter-devel and optionally netdev on patches, netfilter and netfilter-core are unnecessary.

MAINTAINERS +0 -0
index 745643b..860d04f 100644

MAINTAINERS P: Harald Welte · line 3746

Quoted 5 lines
MAINTAINERS +0 -2
@@ -3742,8 +3742,6 @@ P:	Harald Welte
 P:	Jozsef Kadlecsik
 M:	Patrick McHardy <[email protected]>
 L:	[email protected]
-L:	[email protected]
-L:	[email protected]

A comment stating the purpose of each list would be more approriate IMO. netfilter-devel is for developers and patches, netfilter is for users and netfilter-core is only meant to reach the coreteam privately.

#10 lore raw

PATCH v2 1/1 MAINTAINERS: netfilter - Document netfilter and netfilter-core lists purposes

Quoted 7 lines · Patrick McHardy

it's enough to CC netfilter-devel and optionally
netdev on patches, netfilter and netfilter-core are unnecessary. On Mon, 2010-01-11 at 12:14 +0100, Patrick McHardy wrote:
A comment stating the purpose of each list would be more appropriate. netfilter-devel is for developers and patches, netfilter is for users and netfilter-core is only meant to reach the coreteam privately.

Adding "subscribers-only" after the list address stops scripts/get_maintainer.pl from including the address unless --s is used. Doesn't matter if the list really is subscribers-only or not.

MAINTAINERS +2 -2
index 745643b..ea5ddc8 100644
@@ -3742,8 +3742,8 @@ P:	Harald Welte
 P:	Jozsef Kadlecsik
 M:	Patrick McHardy <[email protected]>
 L:	[email protected]
-L:	[email protected]
-L:	[email protected]
+L:	[email protected]	for user issues, not subscribers-only
+L:	[email protected]		for private emails, not subscribers-only
 W:	http://www.netfilter.org/
 W:	http://www.iptables.org/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git
#11 lore raw

Re: [PATCH V2] MAINTAINERS: netfilter - Document netfilter and netfilter-core lists purposes

Quoted 16 lines · Joe Perches

Adding "subscribers-only" after the list address stops scripts/get_maintainer.pl from including the address unless --s is used. Doesn't matter if the list really is subscribers-only or not.

+++ b/MAINTAINERS

(quoted diff) +0 -0
@@ -3742,8 +3742,8 @@ P:	Harald Welte

P: Jozsef Kadlecsik
M: Patrick McHardy <[email protected]>
L: [email protected]

MAINTAINERS +2 -2
-L:	[email protected]
-L:	[email protected]
+L:	[email protected]	for user issues, not subscribers-only
+L:	[email protected]		for private emails, not subscribers-only
Quoted 1 line

W: http://www.netfilter.org/

This is a little stab-through-the-back -
rather than "subscribers-only", I'd use "subscriber-free" or FFA, or just leave it blank and use "subscribers-only" instead for these.

L: [email protected]
L: [email protected] subscribers-only

Quoted 1 line

W: http://www.iptables.org/

netfilter.org/

#12 lore raw

Re: [PATCH V2] MAINTAINERS: netfilter - Document netfilter and netfilter-core lists purposes

Quoted 10 lines · Jan Engelhardt
Quoted 4 lines · Joe Perches

Adding "subscribers-only" after the list address stops scripts/get_maintainer.pl from including the address unless --s is used. Doesn't matter if the list really is subscribers-only or not.

This is a little stab-through-the-back -
rather than "subscribers-only", I'd use "subscriber-free" or FFA, or just leave it blank and use "subscribers-only" instead for these.

You're welcome and free to change the script
and MAINTAINERS.

I think this works well-enough though.

cheers, Joe

#13 lore raw

PATCH v3 1/1 MAINTAINERS: Document list types, add "A:" section type, update NETFILTER

In reply to Jan Engelhardt
Quoted 4 lines · Jan Engelhardt

This is a little stab-through-the-back -
rather than "subscribers-only", I'd use "subscriber-free" or FFA, or just leave it blank and use "subscribers-only" instead for these.

Here's another option:

MAINTAINERS +17 -3
index 745643b..8abf3be 100644
@@ -69,7 +69,20 @@ Descriptions of section entries:
 
 	P: Person (obsolete)
 	M: Mail patches to: FullName <address@domain>
-	L: Mailing list that is relevant to this area
+	L: Mailing list that should receive patches, bug reports or
+	   developer questions.
+	   Mailing lists can be one of:
+	   (open list):	the default, unmarked case
+			Subscription to the list is not required, but emails
+			may be rejected by spam filters without notification.
+	   (moderated for non-subscribers):
+			emails from non-subscribers are actively filtered
+			and may be arbitrarily delayed or rejected without
+			notification if off-topic.  Upon receipt of the email,
+			a moderation notification email may be automatically
+			sent by the list manager.
+	   (subscribers-only):
+			emails from non-subscribers are not accepted.
 	W: Web-page with status/info
 	T: SCM tree type and location.  Type is one of: git, hg, quilt, stgit.
 	S: Status, one of the following:
@@ -102,6 +115,7 @@ Descriptions of section entries:
 	      matches patches or files that contain one or more of the words
 	      printk, pr_info or pr_err
 	   One regex pattern per line.  Multiple K: lines acceptable.
+	A: Additional useful unstructured information.
 
 Note: For the hard of thinking, this list is meant to remain in alphabetical
 order. If you could add yourselves to it in alphabetical order that would be
@@ -3742,8 +3756,8 @@ P:	Harald Welte
 P:	Jozsef Kadlecsik
 M:	Patrick McHardy <[email protected]>
 L:	[email protected]
-L:	[email protected]
-L:	[email protected]
+A:	[email protected]	(email list for user issues)
+A:	[email protected]		(private emails to core developers)
 W:	http://www.netfilter.org/
 W:	http://www.iptables.org/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git
#14 lore raw

Re: [PATCH V3] MAINTAINERS: Document list types, add "A:" section type, update NETFILTER

MAINTAINERS Descriptions of section entries: · line 118

Quoted 1 line · Joe Perches
MAINTAINERS +1 -0
+	A: Additional useful unstructured information.

Can be implemented with a level of indirection via the W: entries.

Signature · 3 lines
Stefan Richter
-=====-==-=- ---= -==-=
http://arcgraph.de/sr/
#15 lore raw

Re: [PATCH V3] MAINTAINERS: Document list types, add "A:" section type, update NETFILTER

Quoted 3 lines · Stefan Richter

MAINTAINERS Descriptions of section entries: · line 118

Quoted 1 line · Joe Perches
MAINTAINERS +1 -0
+	A: Additional useful unstructured information.

Can be implemented with a level of indirection via the W: entries.

Mailing lists aren't web addresses.

#16 lore raw

Re: [PATCH V3] MAINTAINERS: Document list types, add "A:" section type, update NETFILTER

Quoted 6 lines · Joe Perches
Quoted 3 lines · Stefan Richter

MAINTAINERS Descriptions of section entries: · line 118

Quoted 1 line · Joe Perches
MAINTAINERS +1 -0
+	A: Additional useful unstructured information.

Can be implemented with a level of indirection via the W: entries.

Mailing lists aren't web addresses.

Project web sites typically contain contact pages (which is what you used the first two proposed A: entries for --- contacts that apparently do not play a role for patch submission), and web sites can carry any other "unstructured information".

Keep redundancy low.

Signature · 3 lines
Stefan Richter
-=====-==-=- ---= -==-=
http://arcgraph.de/sr/
#17 lore raw

Re: [PATCH V3] MAINTAINERS: Document list types, add "A:" section type, update NETFILTER

Quoted 6 lines · Stefan Richter
Quoted 5 lines · Joe Perches
Quoted 3 lines · Stefan Richter

MAINTAINERS Descriptions of section entries: · line 118

Quoted 1 line · Joe Perches
MAINTAINERS +1 -0
+	A: Additional useful unstructured information.

Can be implemented with a level of indirection via the W: entries.

Quoted 8 lines
Quoted 1 line

Mailing lists aren't web addresses.

Project web sites typically contain contact pages (which is what you used the first two proposed A: entries for --- contacts that apparently do not play a role for patch submission), and web sites can carry any other "unstructured information".

Keep redundancy low.

Well, I'd say that kernel maintainance info should be kept... well... in kernel...
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html