* [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
@ 2013-06-01 1:05 Lorenzo Colitti
2013-06-01 1:05 ` [PATCH v4 2/4] net: ipv6: Unify {raw,udp}6_sock_seq_show Lorenzo Colitti
` (4 more replies)
0 siblings, 5 replies; 21+ messages in thread
From: Lorenzo Colitti @ 2013-06-01 1:05 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, David Miller, YOSHIFUJI Hideaki, Vasiliy Kulikov,
Lorenzo Colitti
Reduce the indentation of most of the functions and make it a
bit more consistent. This allows longer function and arg names
to be consistently indented without wrapping.
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
---
include/net/transp_v6.h | 70 ++++++++++++++++++++++++-------------------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index eb40e71..2d9d0e3 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -7,47 +7,47 @@
* IPv6 transport protocols
*/
-extern struct proto rawv6_prot;
-extern struct proto udpv6_prot;
-extern struct proto udplitev6_prot;
-extern struct proto tcpv6_prot;
-extern struct proto pingv6_prot;
+extern struct proto rawv6_prot;
+extern struct proto udpv6_prot;
+extern struct proto udplitev6_prot;
+extern struct proto tcpv6_prot;
+extern struct proto pingv6_prot;
struct flowi6;
/* extension headers */
-extern int ipv6_exthdrs_init(void);
-extern void ipv6_exthdrs_exit(void);
-extern int ipv6_frag_init(void);
-extern void ipv6_frag_exit(void);
+extern int ipv6_exthdrs_init(void);
+extern void ipv6_exthdrs_exit(void);
+extern int ipv6_frag_init(void);
+extern void ipv6_frag_exit(void);
/* transport protocols */
-extern int pingv6_init(void);
-extern void pingv6_exit(void);
-extern int rawv6_init(void);
-extern void rawv6_exit(void);
-extern int udpv6_init(void);
-extern void udpv6_exit(void);
-extern int udplitev6_init(void);
-extern void udplitev6_exit(void);
-extern int tcpv6_init(void);
-extern void tcpv6_exit(void);
-
-extern int udpv6_connect(struct sock *sk,
- struct sockaddr *uaddr,
- int addr_len);
-
-extern int ip6_datagram_recv_ctl(struct sock *sk,
- struct msghdr *msg,
- struct sk_buff *skb);
-
-extern int ip6_datagram_send_ctl(struct net *net,
- struct sock *sk,
- struct msghdr *msg,
- struct flowi6 *fl6,
- struct ipv6_txoptions *opt,
- int *hlimit, int *tclass,
- int *dontfrag);
+extern int pingv6_init(void);
+extern void pingv6_exit(void);
+extern int rawv6_init(void);
+extern void rawv6_exit(void);
+extern int udpv6_init(void);
+extern void udpv6_exit(void);
+extern int udplitev6_init(void);
+extern void udplitev6_exit(void);
+extern int tcpv6_init(void);
+extern void tcpv6_exit(void);
+
+extern int udpv6_connect(struct sock *sk,
+ struct sockaddr *uaddr,
+ int addr_len);
+
+extern int ip6_datagram_recv_ctl(struct sock *sk,
+ struct msghdr *msg,
+ struct sk_buff *skb);
+
+extern int ip6_datagram_send_ctl(struct net *net,
+ struct sock *sk,
+ struct msghdr *msg,
+ struct flowi6 *fl6,
+ struct ipv6_txoptions *opt,
+ int *hlimit, int *tclass,
+ int *dontfrag);
#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
--
1.8.2.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v4 2/4] net: ipv6: Unify {raw,udp}6_sock_seq_show.
2013-06-01 1:05 [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Lorenzo Colitti
@ 2013-06-01 1:05 ` Lorenzo Colitti
2013-06-04 19:56 ` David Miller
2013-06-01 1:05 ` [PATCH v4 3/4] net: ipv4: make the ping /proc code AF-independent Lorenzo Colitti
` (3 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Lorenzo Colitti @ 2013-06-01 1:05 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, David Miller, YOSHIFUJI Hideaki, Vasiliy Kulikov,
Lorenzo Colitti
udp6_sock_seq_show and raw6_sock_seq_show are identical, except
the UDP version displays ports and the raw version displays the
protocol. Refactor most of the code in these two functions into
a new common ip6_dgram_sock_seq_show function, in preparation
for using it to display ICMPv6 sockets as well.
Also reduce the indentation in parts of include/net/transp_v6.h
to improve readability.
Compiles and displays reasonable results with CONFIG_IPV6={n,m,y}
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
---
include/net/transp_v6.h | 13 +++++++++++++
net/ipv6/datagram.c | 27 +++++++++++++++++++++++++++
net/ipv6/raw.c | 45 ++++++++-------------------------------------
net/ipv6/udp.c | 49 +++++++++----------------------------------------
4 files changed, 57 insertions(+), 77 deletions(-)
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 2d9d0e3..6dddc08 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -49,6 +49,12 @@ extern int ip6_datagram_send_ctl(struct net *net,
int *hlimit, int *tclass,
int *dontfrag);
+extern void ip6_dgram_sock_seq_show(struct seq_file *seq,
+ struct sock *sp,
+ __u16 srcp,
+ __u16 destp,
+ int bucket);
+
#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
/*
@@ -58,4 +64,11 @@ extern const struct inet_connection_sock_af_ops ipv4_specific;
extern void inet6_destroy_sock(struct sock *sk);
+#define IPV6_SEQ_DGRAM_HEADER \
+ " sl " \
+ "local_address " \
+ "remote_address " \
+ "st tx_queue rx_queue tr tm->when retrnsmt" \
+ " uid timeout inode ref pointer drops\n"
+
#endif
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 4b56cbb..197e6f4 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -879,3 +879,30 @@ exit_f:
return err;
}
EXPORT_SYMBOL_GPL(ip6_datagram_send_ctl);
+
+void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
+ __u16 srcp, __u16 destp, int bucket)
+{
+ struct ipv6_pinfo *np = inet6_sk(sp);
+ const struct in6_addr *dest, *src;
+
+ dest = &np->daddr;
+ src = &np->rcv_saddr;
+ seq_printf(seq,
+ "%5d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
+ "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %pK %d\n",
+ bucket,
+ src->s6_addr32[0], src->s6_addr32[1],
+ src->s6_addr32[2], src->s6_addr32[3], srcp,
+ dest->s6_addr32[0], dest->s6_addr32[1],
+ dest->s6_addr32[2], dest->s6_addr32[3], destp,
+ sp->sk_state,
+ sk_wmem_alloc_get(sp),
+ sk_rmem_alloc_get(sp),
+ 0, 0L, 0,
+ from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)),
+ 0,
+ sock_i_ino(sp),
+ atomic_read(&sp->sk_refcnt), sp,
+ atomic_read(&sp->sk_drops));
+}
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 4f8886a..c45f7a5 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1227,45 +1227,16 @@ struct proto rawv6_prot = {
};
#ifdef CONFIG_PROC_FS
-static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
-{
- struct ipv6_pinfo *np = inet6_sk(sp);
- const struct in6_addr *dest, *src;
- __u16 destp, srcp;
-
- dest = &np->daddr;
- src = &np->rcv_saddr;
- destp = 0;
- srcp = inet_sk(sp)->inet_num;
- seq_printf(seq,
- "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
- "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %pK %d\n",
- i,
- src->s6_addr32[0], src->s6_addr32[1],
- src->s6_addr32[2], src->s6_addr32[3], srcp,
- dest->s6_addr32[0], dest->s6_addr32[1],
- dest->s6_addr32[2], dest->s6_addr32[3], destp,
- sp->sk_state,
- sk_wmem_alloc_get(sp),
- sk_rmem_alloc_get(sp),
- 0, 0L, 0,
- from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)),
- 0,
- sock_i_ino(sp),
- atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops));
-}
-
static int raw6_seq_show(struct seq_file *seq, void *v)
{
- if (v == SEQ_START_TOKEN)
- seq_printf(seq,
- " sl "
- "local_address "
- "remote_address "
- "st tx_queue rx_queue tr tm->when retrnsmt"
- " uid timeout inode ref pointer drops\n");
- else
- raw6_sock_seq_show(seq, v, raw_seq_private(seq)->bucket);
+ if (v == SEQ_START_TOKEN) {
+ seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);
+ } else {
+ struct sock *sp = v;
+ __u16 srcp = inet_sk(sp)->inet_num;
+ ip6_dgram_sock_seq_show(seq, v, srcp, 0,
+ raw_seq_private(seq)->bucket);
+ }
return 0;
}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 42923b1..b580853 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1359,48 +1359,17 @@ static const struct inet6_protocol udpv6_protocol = {
/* ------------------------------------------------------------------------ */
#ifdef CONFIG_PROC_FS
-
-static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket)
-{
- struct inet_sock *inet = inet_sk(sp);
- struct ipv6_pinfo *np = inet6_sk(sp);
- const struct in6_addr *dest, *src;
- __u16 destp, srcp;
-
- dest = &np->daddr;
- src = &np->rcv_saddr;
- destp = ntohs(inet->inet_dport);
- srcp = ntohs(inet->inet_sport);
- seq_printf(seq,
- "%5d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
- "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %pK %d\n",
- bucket,
- src->s6_addr32[0], src->s6_addr32[1],
- src->s6_addr32[2], src->s6_addr32[3], srcp,
- dest->s6_addr32[0], dest->s6_addr32[1],
- dest->s6_addr32[2], dest->s6_addr32[3], destp,
- sp->sk_state,
- sk_wmem_alloc_get(sp),
- sk_rmem_alloc_get(sp),
- 0, 0L, 0,
- from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)),
- 0,
- sock_i_ino(sp),
- atomic_read(&sp->sk_refcnt), sp,
- atomic_read(&sp->sk_drops));
-}
-
int udp6_seq_show(struct seq_file *seq, void *v)
{
- if (v == SEQ_START_TOKEN)
- seq_printf(seq,
- " sl "
- "local_address "
- "remote_address "
- "st tx_queue rx_queue tr tm->when retrnsmt"
- " uid timeout inode ref pointer drops\n");
- else
- udp6_sock_seq_show(seq, v, ((struct udp_iter_state *)seq->private)->bucket);
+ if (v == SEQ_START_TOKEN) {
+ seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);
+ } else {
+ int bucket = ((struct udp_iter_state *)seq->private)->bucket;
+ struct inet_sock *inet = inet_sk(v);
+ __u16 srcp = ntohs(inet->inet_sport);
+ __u16 destp = ntohs(inet->inet_dport);
+ ip6_dgram_sock_seq_show(seq, v, srcp, destp, bucket);
+ }
return 0;
}
--
1.8.2.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v4 3/4] net: ipv4: make the ping /proc code AF-independent
2013-06-01 1:05 [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Lorenzo Colitti
2013-06-01 1:05 ` [PATCH v4 2/4] net: ipv6: Unify {raw,udp}6_sock_seq_show Lorenzo Colitti
@ 2013-06-01 1:05 ` Lorenzo Colitti
2013-06-04 19:57 ` David Miller
2013-06-01 1:05 ` [PATCH v4 4/4] net: ipv6: Implement /proc/net/icmp6 Lorenzo Colitti
` (2 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Lorenzo Colitti @ 2013-06-01 1:05 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, David Miller, YOSHIFUJI Hideaki, Vasiliy Kulikov,
Lorenzo Colitti
Introduce a ping_seq_afinfo structure (similar to its UDP
equivalent) and use it to make some of the ping /proc functions
address-family independent. Rename the remaining ping /proc
functions from ping_* to ping_v4_*.
Compiles and displays reasonable results with CONFIG_IPV6={n,m,y}
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
---
include/net/ping.h | 8 ++++++
net/ipv4/ping.c | 73 +++++++++++++++++++++++++++++++++++-------------------
2 files changed, 55 insertions(+), 26 deletions(-)
diff --git a/include/net/ping.h b/include/net/ping.h
index 9242fa0..b9282f0 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -49,6 +49,7 @@ struct ping_table {
struct ping_iter_state {
struct seq_net_private p;
int bucket;
+ sa_family_t family;
};
extern struct proto ping_prot;
@@ -87,6 +88,13 @@ int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
void ping_rcv(struct sk_buff *skb);
#ifdef CONFIG_PROC_FS
+struct ping_seq_afinfo {
+ char *name;
+ sa_family_t family;
+ const struct file_operations *seq_fops;
+ const struct seq_operations seq_ops;
+};
+
extern int __init ping_proc_init(void);
extern void ping_proc_exit(void);
#endif
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 71f6ad0..8c2da9b 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -1001,7 +1001,8 @@ static struct sock *ping_get_first(struct seq_file *seq, int start)
continue;
sk_nulls_for_each(sk, node, hslot) {
- if (net_eq(sock_net(sk), net))
+ if (net_eq(sock_net(sk), net) &&
+ sk->sk_family == state->family)
goto found;
}
}
@@ -1034,16 +1035,23 @@ static struct sock *ping_get_idx(struct seq_file *seq, loff_t pos)
return pos ? NULL : sk;
}
-static void *ping_seq_start(struct seq_file *seq, loff_t *pos)
+static void *ping_seq_start(struct seq_file *seq, loff_t *pos,
+ sa_family_t family)
{
struct ping_iter_state *state = seq->private;
state->bucket = 0;
+ state->family = family;
read_lock_bh(&ping_table.lock);
return *pos ? ping_get_idx(seq, *pos-1) : SEQ_START_TOKEN;
}
+static void *ping_v4_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ return ping_seq_start(seq, pos, AF_INET);
+}
+
static void *ping_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct sock *sk;
@@ -1062,7 +1070,7 @@ static void ping_seq_stop(struct seq_file *seq, void *v)
read_unlock_bh(&ping_table.lock);
}
-static void ping_format_sock(struct sock *sp, struct seq_file *f,
+static void ping_v4_format_sock(struct sock *sp, struct seq_file *f,
int bucket, int *len)
{
struct inet_sock *inet = inet_sk(sp);
@@ -1083,7 +1091,7 @@ static void ping_format_sock(struct sock *sp, struct seq_file *f,
atomic_read(&sp->sk_drops), len);
}
-static int ping_seq_show(struct seq_file *seq, void *v)
+static int ping_v4_seq_show(struct seq_file *seq, void *v)
{
if (v == SEQ_START_TOKEN)
seq_printf(seq, "%-127s\n",
@@ -1094,22 +1102,23 @@ static int ping_seq_show(struct seq_file *seq, void *v)
struct ping_iter_state *state = seq->private;
int len;
- ping_format_sock(v, seq, state->bucket, &len);
+ ping_v4_format_sock(v, seq, state->bucket, &len);
seq_printf(seq, "%*s\n", 127 - len, "");
}
return 0;
}
-static const struct seq_operations ping_seq_ops = {
- .show = ping_seq_show,
- .start = ping_seq_start,
+static const struct seq_operations ping_v4_seq_ops = {
+ .show = ping_v4_seq_show,
+ .start = ping_v4_seq_start,
.next = ping_seq_next,
.stop = ping_seq_stop,
};
static int ping_seq_open(struct inode *inode, struct file *file)
{
- return seq_open_net(inode, file, &ping_seq_ops,
+ struct ping_seq_afinfo *afinfo = PDE_DATA(inode);
+ return seq_open_net(inode, file, &afinfo->seq_ops,
sizeof(struct ping_iter_state));
}
@@ -1120,46 +1129,58 @@ static const struct file_operations ping_seq_fops = {
.release = seq_release_net,
};
-static int ping_proc_register(struct net *net)
+static struct ping_seq_afinfo ping_v4_seq_afinfo = {
+ .name = "icmp",
+ .family = AF_INET,
+ .seq_fops = &ping_seq_fops,
+ .seq_ops = {
+ .start = ping_v4_seq_start,
+ .show = ping_v4_seq_show,
+ .next = ping_seq_next,
+ .stop = ping_seq_stop,
+ },
+};
+
+static int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo)
{
struct proc_dir_entry *p;
- int rc = 0;
-
- p = proc_create("icmp", S_IRUGO, net->proc_net, &ping_seq_fops);
+ p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
+ afinfo->seq_fops, afinfo);
if (!p)
- rc = -ENOMEM;
- return rc;
+ return -ENOMEM;
+ return 0;
}
-static void ping_proc_unregister(struct net *net)
+static void ping_proc_unregister(struct net *net,
+ struct ping_seq_afinfo *afinfo)
{
- remove_proc_entry("icmp", net->proc_net);
+ remove_proc_entry(afinfo->name, net->proc_net);
}
-static int __net_init ping_proc_init_net(struct net *net)
+static int __net_init ping_v4_proc_init_net(struct net *net)
{
- return ping_proc_register(net);
+ return ping_proc_register(net, &ping_v4_seq_afinfo);
}
-static void __net_exit ping_proc_exit_net(struct net *net)
+static void __net_exit ping_v4_proc_exit_net(struct net *net)
{
- ping_proc_unregister(net);
+ ping_proc_unregister(net, &ping_v4_seq_afinfo);
}
-static struct pernet_operations ping_net_ops = {
- .init = ping_proc_init_net,
- .exit = ping_proc_exit_net,
+static struct pernet_operations ping_v4_net_ops = {
+ .init = ping_v4_proc_init_net,
+ .exit = ping_v4_proc_exit_net,
};
int __init ping_proc_init(void)
{
- return register_pernet_subsys(&ping_net_ops);
+ return register_pernet_subsys(&ping_v4_net_ops);
}
void ping_proc_exit(void)
{
- unregister_pernet_subsys(&ping_net_ops);
+ unregister_pernet_subsys(&ping_v4_net_ops);
}
#endif
--
1.8.2.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v4 4/4] net: ipv6: Implement /proc/net/icmp6.
2013-06-01 1:05 [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Lorenzo Colitti
2013-06-01 1:05 ` [PATCH v4 2/4] net: ipv6: Unify {raw,udp}6_sock_seq_show Lorenzo Colitti
2013-06-01 1:05 ` [PATCH v4 3/4] net: ipv4: make the ping /proc code AF-independent Lorenzo Colitti
@ 2013-06-01 1:05 ` Lorenzo Colitti
2013-06-04 19:57 ` David Miller
2013-06-01 1:25 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Joe Perches
2013-06-04 19:56 ` David Miller
4 siblings, 1 reply; 21+ messages in thread
From: Lorenzo Colitti @ 2013-06-01 1:05 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, David Miller, YOSHIFUJI Hideaki, Vasiliy Kulikov,
Lorenzo Colitti
The format is based on /proc/net/icmp and /proc/net/{udp,raw}6.
Compiles and displays reasonable results with CONFIG_IPV6={n,m,y}
Couldn't figure out how to test without CONFIG_PROC_FS enabled.
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
---
include/net/ping.h | 8 +++++
net/ipv4/ping.c | 21 ++++++-----
net/ipv6/ping.c | 102 +++++++++++++++++++++++++++++++++++++++++------------
3 files changed, 99 insertions(+), 32 deletions(-)
diff --git a/include/net/ping.h b/include/net/ping.h
index b9282f0..db04802 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -95,6 +95,14 @@ struct ping_seq_afinfo {
const struct seq_operations seq_ops;
};
+extern const struct file_operations ping_seq_fops;
+
+void *ping_seq_start(struct seq_file *seq, loff_t *pos, sa_family_t family);
+void *ping_seq_next(struct seq_file *seq, void *v, loff_t *pos);
+void ping_seq_stop(struct seq_file *seq, void *v);
+int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo);
+void ping_proc_unregister(struct net *net, struct ping_seq_afinfo *afinfo);
+
extern int __init ping_proc_init(void);
extern void ping_proc_exit(void);
#endif
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 8c2da9b..3552a45 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -1035,8 +1035,7 @@ static struct sock *ping_get_idx(struct seq_file *seq, loff_t pos)
return pos ? NULL : sk;
}
-static void *ping_seq_start(struct seq_file *seq, loff_t *pos,
- sa_family_t family)
+void *ping_seq_start(struct seq_file *seq, loff_t *pos, sa_family_t family)
{
struct ping_iter_state *state = seq->private;
state->bucket = 0;
@@ -1046,13 +1045,14 @@ static void *ping_seq_start(struct seq_file *seq, loff_t *pos,
return *pos ? ping_get_idx(seq, *pos-1) : SEQ_START_TOKEN;
}
+EXPORT_SYMBOL_GPL(ping_seq_start);
static void *ping_v4_seq_start(struct seq_file *seq, loff_t *pos)
{
return ping_seq_start(seq, pos, AF_INET);
}
-static void *ping_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+void *ping_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct sock *sk;
@@ -1064,11 +1064,13 @@ static void *ping_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos;
return sk;
}
+EXPORT_SYMBOL_GPL(ping_seq_next);
-static void ping_seq_stop(struct seq_file *seq, void *v)
+void ping_seq_stop(struct seq_file *seq, void *v)
{
read_unlock_bh(&ping_table.lock);
}
+EXPORT_SYMBOL_GPL(ping_seq_stop);
static void ping_v4_format_sock(struct sock *sp, struct seq_file *f,
int bucket, int *len)
@@ -1122,12 +1124,13 @@ static int ping_seq_open(struct inode *inode, struct file *file)
sizeof(struct ping_iter_state));
}
-static const struct file_operations ping_seq_fops = {
+const struct file_operations ping_seq_fops = {
.open = ping_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_net,
};
+EXPORT_SYMBOL_GPL(ping_seq_fops);
static struct ping_seq_afinfo ping_v4_seq_afinfo = {
.name = "icmp",
@@ -1141,7 +1144,7 @@ static struct ping_seq_afinfo ping_v4_seq_afinfo = {
},
};
-static int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo)
+int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo)
{
struct proc_dir_entry *p;
p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
@@ -1150,13 +1153,13 @@ static int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo)
return -ENOMEM;
return 0;
}
+EXPORT_SYMBOL_GPL(ping_proc_register);
-static void ping_proc_unregister(struct net *net,
- struct ping_seq_afinfo *afinfo)
+void ping_proc_unregister(struct net *net, struct ping_seq_afinfo *afinfo)
{
remove_proc_entry(afinfo->name, net->proc_net);
}
-
+EXPORT_SYMBOL_GPL(ping_proc_unregister);
static int __net_init ping_v4_proc_init_net(struct net *net)
{
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index a6462d6..62ac5f2 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -78,29 +78,6 @@ int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
return 0;
}
-int __init pingv6_init(void)
-{
- pingv6_ops.ipv6_recv_error = ipv6_recv_error;
- pingv6_ops.ip6_datagram_recv_ctl = ip6_datagram_recv_ctl;
- pingv6_ops.icmpv6_err_convert = icmpv6_err_convert;
- pingv6_ops.ipv6_icmp_error = ipv6_icmp_error;
- pingv6_ops.ipv6_chk_addr = ipv6_chk_addr;
- return inet6_register_protosw(&pingv6_protosw);
-}
-
-/* This never gets called because it's not possible to unload the ipv6 module,
- * but just in case.
- */
-void pingv6_exit(void)
-{
- pingv6_ops.ipv6_recv_error = dummy_ipv6_recv_error;
- pingv6_ops.ip6_datagram_recv_ctl = dummy_ip6_datagram_recv_ctl;
- pingv6_ops.icmpv6_err_convert = dummy_icmpv6_err_convert;
- pingv6_ops.ipv6_icmp_error = dummy_ipv6_icmp_error;
- pingv6_ops.ipv6_chk_addr = dummy_ipv6_chk_addr;
- inet6_unregister_protosw(&pingv6_protosw);
-}
-
int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len)
{
@@ -214,3 +191,82 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
return err;
}
+
+#ifdef CONFIG_PROC_FS
+static void *ping_v6_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ return ping_seq_start(seq, pos, AF_INET6);
+}
+
+int ping_v6_seq_show(struct seq_file *seq, void *v)
+{
+ if (v == SEQ_START_TOKEN) {
+ seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);
+ } else {
+ int bucket = ((struct ping_iter_state *) seq->private)->bucket;
+ struct inet_sock *inet = inet_sk(v);
+ __u16 srcp = ntohs(inet->inet_sport);
+ __u16 destp = ntohs(inet->inet_dport);
+ ip6_dgram_sock_seq_show(seq, v, srcp, destp, bucket);
+ }
+ return 0;
+}
+
+static struct ping_seq_afinfo ping_v6_seq_afinfo = {
+ .name = "icmp6",
+ .family = AF_INET6,
+ .seq_fops = &ping_seq_fops,
+ .seq_ops = {
+ .start = ping_v6_seq_start,
+ .show = ping_v6_seq_show,
+ .next = ping_seq_next,
+ .stop = ping_seq_stop,
+ },
+};
+
+static int __net_init ping_v6_proc_init_net(struct net *net)
+{
+ return ping_proc_register(net, &ping_v6_seq_afinfo);
+}
+
+static void __net_init ping_v6_proc_exit_net(struct net *net)
+{
+ return ping_proc_unregister(net, &ping_v6_seq_afinfo);
+}
+
+static struct pernet_operations ping_v6_net_ops = {
+ .init = ping_v6_proc_init_net,
+ .exit = ping_v6_proc_exit_net,
+};
+#endif
+
+int __init pingv6_init(void)
+{
+#ifdef CONFIG_PROC_FS
+ int ret = register_pernet_subsys(&ping_v6_net_ops);
+ if (ret)
+ return ret;
+#endif
+ pingv6_ops.ipv6_recv_error = ipv6_recv_error;
+ pingv6_ops.ip6_datagram_recv_ctl = ip6_datagram_recv_ctl;
+ pingv6_ops.icmpv6_err_convert = icmpv6_err_convert;
+ pingv6_ops.ipv6_icmp_error = ipv6_icmp_error;
+ pingv6_ops.ipv6_chk_addr = ipv6_chk_addr;
+ return inet6_register_protosw(&pingv6_protosw);
+}
+
+/* This never gets called because it's not possible to unload the ipv6 module,
+ * but just in case.
+ */
+void pingv6_exit(void)
+{
+ pingv6_ops.ipv6_recv_error = dummy_ipv6_recv_error;
+ pingv6_ops.ip6_datagram_recv_ctl = dummy_ip6_datagram_recv_ctl;
+ pingv6_ops.icmpv6_err_convert = dummy_icmpv6_err_convert;
+ pingv6_ops.ipv6_icmp_error = dummy_ipv6_icmp_error;
+ pingv6_ops.ipv6_chk_addr = dummy_ipv6_chk_addr;
+#ifdef CONFIG_PROC_FS
+ unregister_pernet_subsys(&ping_v6_net_ops);
+#endif
+ inet6_unregister_protosw(&pingv6_protosw);
+}
--
1.8.2.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-01 1:05 [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Lorenzo Colitti
` (2 preceding siblings ...)
2013-06-01 1:05 ` [PATCH v4 4/4] net: ipv6: Implement /proc/net/icmp6 Lorenzo Colitti
@ 2013-06-01 1:25 ` Joe Perches
2013-06-02 2:58 ` David Miller
2013-06-04 19:56 ` David Miller
4 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2013-06-01 1:25 UTC (permalink / raw)
To: Lorenzo Colitti
Cc: netdev, Eric Dumazet, David Miller, YOSHIFUJI Hideaki,
Vasiliy Kulikov
On Sat, 2013-06-01 at 10:05 +0900, Lorenzo Colitti wrote:
> Reduce the indentation of most of the functions and make it a
> bit more consistent. This allows longer function and arg names
> to be consistently indented without wrapping.
[]
> diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
[]
> @@ -7,47 +7,47 @@
[]
> /* extension headers */
> -extern int ipv6_exthdrs_init(void);
[]
> +extern int ipv6_exthdrs_init(void);
externs aren't useful here and I suggest prototypes like
int ipv6_exthdrs_init(void);
> -extern int ip6_datagram_send_ctl(struct net *net,
> - struct sock *sk,
> - struct msghdr *msg,
> - struct flowi6 *fl6,
> - struct ipv6_txoptions *opt,
> - int *hlimit, int *tclass,
> - int *dontfrag);
[]
> +extern int ip6_datagram_send_ctl(struct net *net,
> + struct sock *sk,
> + struct msghdr *msg,
> + struct flowi6 *fl6,
> + struct ipv6_txoptions *opt,
> + int *hlimit, int *tclass,
> + int *dontfrag);
int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
struct flowi6 *fl6, struct ipv6_txoptions *opt,
int *hlimit, int *tclass, int *dontfrag);
etc...
kernel_doc might be nice too
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-01 1:25 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Joe Perches
@ 2013-06-02 2:58 ` David Miller
2013-06-02 3:06 ` Joe Perches
0 siblings, 1 reply; 21+ messages in thread
From: David Miller @ 2013-06-02 2:58 UTC (permalink / raw)
To: joe; +Cc: lorenzo, netdev, edumazet, yoshfuji, segoon
From: Joe Perches <joe@perches.com>
Date: Fri, 31 May 2013 18:25:40 -0700
> externs aren't useful here and I suggest prototypes like
> int ipv6_exthdrs_init(void);
But this is the format used by the entire header file, all functions
are declared extern.
It is not reasonable to ask him to change this. It's a seperate
cleanup, and that's assuming we actually agree to remove the externs.
I honestly see no reason to, they are harmless, and given that it's
just pure churn.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 2:58 ` David Miller
@ 2013-06-02 3:06 ` Joe Perches
2013-06-02 3:44 ` Lorenzo Colitti
2013-06-02 8:29 ` David Miller
0 siblings, 2 replies; 21+ messages in thread
From: Joe Perches @ 2013-06-02 3:06 UTC (permalink / raw)
To: David Miller; +Cc: lorenzo, netdev, edumazet, yoshfuji, segoon
On Sat, 2013-06-01 at 19:58 -0700, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Fri, 31 May 2013 18:25:40 -0700
>
> > externs aren't useful here and I suggest prototypes like
> > int ipv6_exthdrs_init(void);
>
> But this is the format used by the entire header file, all functions
> are declared extern.
>
> It is not reasonable to ask him to change this. It's a seperate
> cleanup, and that's assuming we actually agree to remove the externs.
> I honestly see no reason to, they are harmless, and given that it's
> just pure churn.
<shrug>
How is that churn different than the entire patch?
extern _isn't_ useful and the tabbed indentation is
different than most all includes.
1 tab or 2 isn't a big thing.
I think cleanup patches like this should strive for
consistency with whatever preferred style exists.
If a cleanup only patch is proffered, I think the
cleanup should be as complete as possible.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 3:06 ` Joe Perches
@ 2013-06-02 3:44 ` Lorenzo Colitti
2013-06-02 3:52 ` Joe Perches
2013-06-02 8:29 ` David Miller
1 sibling, 1 reply; 21+ messages in thread
From: Lorenzo Colitti @ 2013-06-02 3:44 UTC (permalink / raw)
To: Joe Perches
Cc: David Miller, netdev@vger.kernel.org, Eric Dumazet,
YOSHIFUJI Hideaki, Vasiliy Kulikov
On Sun, Jun 2, 2013 at 12:06 PM, Joe Perches <joe@perches.com> wrote:
> How is that churn different than the entire patch?
I changed the indentation because patch 2 in the set introduced
another function and I didn't know how to indent it. Currently, some
declarations are not tab-indented, some are tab-indented to column 40,
and some are tab-indented to column 32. I thought that while I was at
it I might change them to be consistent. So this patch changes it so
they're all tab-indented to column 24; I thought that was more
readable.
That said, I don't have strong feelings about the indentation - my
main goal here was removing code duplication. If I reverted the
indentation patch and just aligned the new function to the function
above it, would that be better?
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 3:44 ` Lorenzo Colitti
@ 2013-06-02 3:52 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2013-06-02 3:52 UTC (permalink / raw)
To: Lorenzo Colitti
Cc: David Miller, netdev@vger.kernel.org, Eric Dumazet,
YOSHIFUJI Hideaki, Vasiliy Kulikov
On Sun, 2013-06-02 at 12:44 +0900, Lorenzo Colitti wrote:
> On Sun, Jun 2, 2013 at 12:06 PM, Joe Perches <joe@perches.com> wrote:
> > How is that churn different than the entire patch?
>
> I changed the indentation because patch 2 in the set introduced
> another function and I didn't know how to indent it. Currently, some
> declarations are not tab-indented, some are tab-indented to column 40,
> and some are tab-indented to column 32. I thought that while I was at
> it I might change them to be consistent. So this patch changes it so
> they're all tab-indented to column 24; I thought that was more
> readable.
>
> That said, I don't have strong feelings about the indentation - my
> main goal here was removing code duplication. If I reverted the
> indentation patch and just aligned the new function to the function
> above it, would that be better?
Hey Lorenzo.
I think you should use whatever you think appropriate without
trying to fix the other function prototypes.
Otherwise, I'd do what I suggested in my first email.
cheers, Joe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 3:06 ` Joe Perches
2013-06-02 3:44 ` Lorenzo Colitti
@ 2013-06-02 8:29 ` David Miller
2013-06-02 9:23 ` Joe Perches
1 sibling, 1 reply; 21+ messages in thread
From: David Miller @ 2013-06-02 8:29 UTC (permalink / raw)
To: joe; +Cc: lorenzo, netdev, edumazet, yoshfuji, segoon
From: Joe Perches <joe@perches.com>
Date: Sat, 01 Jun 2013 20:06:08 -0700
> If a cleanup only patch is proffered, I think the
> cleanup should be as complete as possible.
Wanting to clean up one aspect does not require cleaning up
other aspects, many contributors are volunteers remember. :-)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 8:29 ` David Miller
@ 2013-06-02 9:23 ` Joe Perches
2013-06-02 10:35 ` Lorenzo Colitti
2013-06-02 14:16 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Eric Dumazet
0 siblings, 2 replies; 21+ messages in thread
From: Joe Perches @ 2013-06-02 9:23 UTC (permalink / raw)
To: David Miller; +Cc: lorenzo, netdev, edumazet, yoshfuji, segoon
On Sun, 2013-06-02 at 01:29 -0700, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Sat, 01 Jun 2013 20:06:08 -0700
>
> > If a cleanup only patch is proffered, I think the
> > cleanup should be as complete as possible.
>
> Wanting to clean up one aspect does not require cleaning up
> other aspects,
Though I'm in favor of changing content to match any
preferred style, what was that bit about pure churn again?
Just about every line in that file was touched.
> many contributors are volunteers remember. :-)
I get the volunteer aspect, but from a google.com
address?
Lorenzo, take any advice from me with whatever salts you
think appropriate. Avoid the designer bath ones though.
cheers, Joe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 9:23 ` Joe Perches
@ 2013-06-02 10:35 ` Lorenzo Colitti
2013-06-02 17:04 ` [PATCH net-next post Lorenzo] transp_v6.h: style neatening Joe Perches
2013-06-02 14:16 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Eric Dumazet
1 sibling, 1 reply; 21+ messages in thread
From: Lorenzo Colitti @ 2013-06-02 10:35 UTC (permalink / raw)
To: Joe Perches
Cc: David Miller, netdev@vger.kernel.org, Eric Dumazet,
YOSHIFUJI Hideaki, Vasiliy Kulikov
On Sun, Jun 2, 2013 at 6:23 PM, Joe Perches <joe@perches.com> wrote:
> Lorenzo, take any advice from me with whatever salts you
> think appropriate. Avoid the designer bath ones though.
Ok, so I can:
1. Not touch any of the other functions, and add the new function
prototype without any tabs (inconsistent with the others).
2. Not touch any of the other functions, and add the new function
prototype tab-indented the same as the function above it (preserves
the status quo).
3. Remove all the externs in the function prototypes, and all the
middle-of-line tabs in the file, and add the new function prototype in
the same way.
Any of the above is fine by me. Is there one which you guys agree on?
I don't have strong feelings about indentation, but if possible I
would like to avoid re-spinning this patchset more than twice over
formatting changes to this file.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 9:23 ` Joe Perches
2013-06-02 10:35 ` Lorenzo Colitti
@ 2013-06-02 14:16 ` Eric Dumazet
2013-06-02 17:30 ` Joe Perches
1 sibling, 1 reply; 21+ messages in thread
From: Eric Dumazet @ 2013-06-02 14:16 UTC (permalink / raw)
To: Joe Perches; +Cc: David Miller, lorenzo, netdev, edumazet, yoshfuji, segoon
On Sun, 2013-06-02 at 02:23 -0700, Joe Perches wrote:
> I get the volunteer aspect, but from a google.com
> address?
So what ?
Lorenzo days have 24 hours, and are not exclusive property of Google,
thank you.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH net-next post Lorenzo] transp_v6.h: style neatening
2013-06-02 10:35 ` Lorenzo Colitti
@ 2013-06-02 17:04 ` Joe Perches
2013-06-03 2:20 ` Lorenzo Colitti
0 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2013-06-02 17:04 UTC (permalink / raw)
To: Lorenzo Colitti
Cc: David Miller, netdev@vger.kernel.org, Eric Dumazet,
YOSHIFUJI Hideaki, Vasiliy Kulikov
Use a more current code style.
Remove extern from function prototypes.
Align function arguments and reflow to 80 cols.
Use network comment styles.
Signed-off-by: Joe Perches <joe@perches.com>
cc: Lorenzo Colitti <lorenzo@google.com>,
---
> I don't have strong feelings about indentation, but if possible I
> would like to avoid re-spinning this patchset more than twice over
> formatting changes to this file.
You could do nothing and David could apply this if
he wants a more complete neatening.
Or do what David wants. He's the maintainer.
include/net/transp_v6.h | 89 ++++++++++++++++++++-----------------------------
1 file changed, 37 insertions(+), 52 deletions(-)
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 6dddc08..48660e5 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -3,72 +3,57 @@
#include <net/checksum.h>
-/*
- * IPv6 transport protocols
- */
-
-extern struct proto rawv6_prot;
-extern struct proto udpv6_prot;
-extern struct proto udplitev6_prot;
-extern struct proto tcpv6_prot;
-extern struct proto pingv6_prot;
+/* IPv6 transport protocols */
+extern struct proto rawv6_prot;
+extern struct proto udpv6_prot;
+extern struct proto udplitev6_prot;
+extern struct proto tcpv6_prot;
+extern struct proto pingv6_prot;
struct flowi6;
/* extension headers */
-extern int ipv6_exthdrs_init(void);
-extern void ipv6_exthdrs_exit(void);
-extern int ipv6_frag_init(void);
-extern void ipv6_frag_exit(void);
+int ipv6_exthdrs_init(void);
+void ipv6_exthdrs_exit(void);
+int ipv6_frag_init(void);
+void ipv6_frag_exit(void);
/* transport protocols */
-extern int pingv6_init(void);
-extern void pingv6_exit(void);
-extern int rawv6_init(void);
-extern void rawv6_exit(void);
-extern int udpv6_init(void);
-extern void udpv6_exit(void);
-extern int udplitev6_init(void);
-extern void udplitev6_exit(void);
-extern int tcpv6_init(void);
-extern void tcpv6_exit(void);
+int pingv6_init(void);
+void pingv6_exit(void);
+int rawv6_init(void);
+void rawv6_exit(void);
+int udpv6_init(void);
+void udpv6_exit(void);
+int udplitev6_init(void);
+void udplitev6_exit(void);
+int tcpv6_init(void);
+void tcpv6_exit(void);
-extern int udpv6_connect(struct sock *sk,
- struct sockaddr *uaddr,
- int addr_len);
+int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
-extern int ip6_datagram_recv_ctl(struct sock *sk,
- struct msghdr *msg,
- struct sk_buff *skb);
+int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
+ struct sk_buff *skb);
-extern int ip6_datagram_send_ctl(struct net *net,
- struct sock *sk,
- struct msghdr *msg,
- struct flowi6 *fl6,
- struct ipv6_txoptions *opt,
- int *hlimit, int *tclass,
- int *dontfrag);
+int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
+ struct flowi6 *fl6, struct ipv6_txoptions *opt,
+ int *hlimit, int *tclass, int *dontfrag);
-extern void ip6_dgram_sock_seq_show(struct seq_file *seq,
- struct sock *sp,
- __u16 srcp,
- __u16 destp,
- int bucket);
+void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
+ __u16 srcp, __u16 destp, int bucket);
-#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
+#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
-/*
- * address family specific functions
- */
+/* address family specific functions */
extern const struct inet_connection_sock_af_ops ipv4_specific;
-extern void inet6_destroy_sock(struct sock *sk);
+void inet6_destroy_sock(struct sock *sk);
-#define IPV6_SEQ_DGRAM_HEADER \
- " sl " \
- "local_address " \
- "remote_address " \
- "st tx_queue rx_queue tr tm->when retrnsmt" \
- " uid timeout inode ref pointer drops\n"
+#define IPV6_SEQ_DGRAM_HEADER \
+ " sl " \
+ "local_address " \
+ "remote_address " \
+ "st tx_queue rx_queue tr tm->when retrnsmt" \
+ " uid timeout inode ref pointer drops\n"
#endif
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-02 14:16 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Eric Dumazet
@ 2013-06-02 17:30 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2013-06-02 17:30 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, lorenzo, netdev, edumazet, yoshfuji, segoon
On Sun, 2013-06-02 at 07:16 -0700, Eric Dumazet wrote:
> On Sun, 2013-06-02 at 02:23 -0700, Joe Perches wrote:
>
> > I get the volunteer aspect, but from a google.com
> > address?
>
> So what ?
>
> Lorenzo days have 24 hours, and are not exclusive property of Google,
> thank you.
Isn't that what gmail addresses are for? :)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH net-next post Lorenzo] transp_v6.h: style neatening
2013-06-02 17:04 ` [PATCH net-next post Lorenzo] transp_v6.h: style neatening Joe Perches
@ 2013-06-03 2:20 ` Lorenzo Colitti
2013-06-03 2:34 ` Joe Perches
0 siblings, 1 reply; 21+ messages in thread
From: Lorenzo Colitti @ 2013-06-03 2:20 UTC (permalink / raw)
To: Joe Perches, David Miller
Cc: netdev@vger.kernel.org, Eric Dumazet, YOSHIFUJI Hideaki,
Vasiliy Kulikov
On Mon, Jun 3, 2013 at 2:04 AM, Joe Perches <joe@perches.com> wrote:
>> I don't have strong feelings about indentation, but if possible I
>> would like to avoid re-spinning this patchset more than twice over
>> formatting changes to this file.
>
> You could do nothing and David could apply this if
> he wants a more complete neatening.
Joe, thanks for saving me a respin. I'd have been happy to do it
myself too, it's just that I'm a bit confused on what the style
actually needs to be.
David - if I have to respin the patch anyway because of other issues
we might uncover, I take it you'd like me to make the new patch use
this indentation?
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH net-next post Lorenzo] transp_v6.h: style neatening
2013-06-03 2:20 ` Lorenzo Colitti
@ 2013-06-03 2:34 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2013-06-03 2:34 UTC (permalink / raw)
To: Lorenzo Colitti
Cc: David Miller, netdev@vger.kernel.org, Eric Dumazet,
YOSHIFUJI Hideaki, Vasiliy Kulikov
On Mon, 2013-06-03 at 11:20 +0900, Lorenzo Colitti wrote:
> On Mon, Jun 3, 2013 at 2:04 AM, Joe Perches <joe@perches.com> wrote:
> >> I don't have strong feelings about indentation, but if possible I
> >> would like to avoid re-spinning this patchset more than twice over
> >> formatting changes to this file.
> >
> > You could do nothing and David could apply this if
> > he wants a more complete neatening.
>
> Joe, thanks for saving me a respin. I'd have been happy to do it
> myself too, it's just that I'm a bit confused on what the style
> actually needs to be.
For now, it's whatever style David wants it to be.
A lot of the net/ code was written before more standardized
coding styles were generally settled upon for networking
and the older code is much less standardized.
It's going to be a tradeoff between "churn" in code that
doesn't have to change much at all and whatever patch rate
for whitespace style conformity David decides to accept.
> I take it you'd like me to make the new patch use
> this indentation?
Well, I would, but David will chime in eventually.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h
2013-06-01 1:05 [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Lorenzo Colitti
` (3 preceding siblings ...)
2013-06-01 1:25 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Joe Perches
@ 2013-06-04 19:56 ` David Miller
4 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-06-04 19:56 UTC (permalink / raw)
To: lorenzo; +Cc: netdev, edumazet, yoshfuji, segoon
From: Lorenzo Colitti <lorenzo@google.com>
Date: Sat, 1 Jun 2013 10:05:47 +0900
> Reduce the indentation of most of the functions and make it a
> bit more consistent. This allows longer function and arg names
> to be consistently indented without wrapping.
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Applied.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/4] net: ipv6: Unify {raw,udp}6_sock_seq_show.
2013-06-01 1:05 ` [PATCH v4 2/4] net: ipv6: Unify {raw,udp}6_sock_seq_show Lorenzo Colitti
@ 2013-06-04 19:56 ` David Miller
0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-06-04 19:56 UTC (permalink / raw)
To: lorenzo; +Cc: netdev, edumazet, yoshfuji, segoon
From: Lorenzo Colitti <lorenzo@google.com>
Date: Sat, 1 Jun 2013 10:05:48 +0900
> udp6_sock_seq_show and raw6_sock_seq_show are identical, except
> the UDP version displays ports and the raw version displays the
> protocol. Refactor most of the code in these two functions into
> a new common ip6_dgram_sock_seq_show function, in preparation
> for using it to display ICMPv6 sockets as well.
>
> Also reduce the indentation in parts of include/net/transp_v6.h
> to improve readability.
>
> Compiles and displays reasonable results with CONFIG_IPV6={n,m,y}
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Applied.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 3/4] net: ipv4: make the ping /proc code AF-independent
2013-06-01 1:05 ` [PATCH v4 3/4] net: ipv4: make the ping /proc code AF-independent Lorenzo Colitti
@ 2013-06-04 19:57 ` David Miller
0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-06-04 19:57 UTC (permalink / raw)
To: lorenzo; +Cc: netdev, edumazet, yoshfuji, segoon
From: Lorenzo Colitti <lorenzo@google.com>
Date: Sat, 1 Jun 2013 10:05:49 +0900
> Introduce a ping_seq_afinfo structure (similar to its UDP
> equivalent) and use it to make some of the ping /proc functions
> address-family independent. Rename the remaining ping /proc
> functions from ping_* to ping_v4_*.
>
> Compiles and displays reasonable results with CONFIG_IPV6={n,m,y}
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Applied.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 4/4] net: ipv6: Implement /proc/net/icmp6.
2013-06-01 1:05 ` [PATCH v4 4/4] net: ipv6: Implement /proc/net/icmp6 Lorenzo Colitti
@ 2013-06-04 19:57 ` David Miller
0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-06-04 19:57 UTC (permalink / raw)
To: lorenzo; +Cc: netdev, edumazet, yoshfuji, segoon
From: Lorenzo Colitti <lorenzo@google.com>
Date: Sat, 1 Jun 2013 10:05:50 +0900
> The format is based on /proc/net/icmp and /proc/net/{udp,raw}6.
>
> Compiles and displays reasonable results with CONFIG_IPV6={n,m,y}
> Couldn't figure out how to test without CONFIG_PROC_FS enabled.
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Applied.
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2013-06-04 19:57 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01 1:05 [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Lorenzo Colitti
2013-06-01 1:05 ` [PATCH v4 2/4] net: ipv6: Unify {raw,udp}6_sock_seq_show Lorenzo Colitti
2013-06-04 19:56 ` David Miller
2013-06-01 1:05 ` [PATCH v4 3/4] net: ipv4: make the ping /proc code AF-independent Lorenzo Colitti
2013-06-04 19:57 ` David Miller
2013-06-01 1:05 ` [PATCH v4 4/4] net: ipv6: Implement /proc/net/icmp6 Lorenzo Colitti
2013-06-04 19:57 ` David Miller
2013-06-01 1:25 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Joe Perches
2013-06-02 2:58 ` David Miller
2013-06-02 3:06 ` Joe Perches
2013-06-02 3:44 ` Lorenzo Colitti
2013-06-02 3:52 ` Joe Perches
2013-06-02 8:29 ` David Miller
2013-06-02 9:23 ` Joe Perches
2013-06-02 10:35 ` Lorenzo Colitti
2013-06-02 17:04 ` [PATCH net-next post Lorenzo] transp_v6.h: style neatening Joe Perches
2013-06-03 2:20 ` Lorenzo Colitti
2013-06-03 2:34 ` Joe Perches
2013-06-02 14:16 ` [PATCH v4 1/4] Clean up indentation in net/ipv6/transp_v6.h Eric Dumazet
2013-06-02 17:30 ` Joe Perches
2013-06-04 19:56 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).