Skip to contentSkip to conversation

tcp_probe: a trivial fix for mismatched number of printl arguments.

PATCH In review Sangtae Ha 2 participants 3 messages May 21, 2007

Subsystems (3)
lore
Share & tools
lore

Sangtae Ha

author
#0 lore raw

PATCH 1/1 tcp_probe: a trivial fix for mismatched number of printl arguments.

Just a fix to correct the number of printl arguments. Now, srtt is logging correctly.

---
 net/ipv4/tcp_probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/tcp_probe.c +1 -1
index 3938d5d..1b72c55 100644
@@ -95,7 +95,7 @@ static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 	/* Only update if port matches */
 	if ((port == 0 || ntohs(inet->dport) == port || ntohs(inet->sport) == port)
 	    && (full || tp->snd_cwnd != tcpw.lastcwnd)) {
-		printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u\n",
+		printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u %u\n",
 		       NIPQUAD(inet->saddr), ntohs(inet->sport),
 		       NIPQUAD(inet->daddr), ntohs(inet->dport),
 		       skb->len, tp->snd_nxt, tp->snd_una,
Signature · 1 line
1.5.0.6
#1 lore raw
Quoted 12 lines · On Mon, 21 May 2007 03:45:42 -0400 Sangtae Ha <[email protected]> wrote:

Just a fix to correct the number of printl arguments. Now, srtt is logging correctly.

---
 net/ipv4/tcp_probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/tcp_probe.c +0 -0
index 3938d5d..1b72c55 100644

net/ipv4/tcp_probe.c static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb, · line 101

Quoted 8 lines
net/ipv4/tcp_probe.c +1 -1
@@ -95,7 +95,7 @@ static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 	/* Only update if port matches */
 	if ((port == 0 || ntohs(inet->dport) == port || ntohs(inet->sport) == port)
 	    && (full || tp->snd_cwnd != tcpw.lastcwnd)) {
-		printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u\n",
+		printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u %u\n",
 		       NIPQUAD(inet->saddr), ntohs(inet->sport),
 		       NIPQUAD(inet->daddr), ntohs(inet->dport),
 		       skb->len, tp->snd_nxt, tp->snd_una,

Looks good thanks

Signature · 1 line
Stephen Hemminger <[email protected]>
#2 lore raw

Re: [PATCH] tcp_probe: use GCC printf attribute

In reply to Sangtae Ha

The function in tcp_probe is printf like, use GCC to check the args.

---
 net/ipv4/tcp_probe.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/tcp_probe.c +2 -1
@@ -80,7 +80,8 @@ static void printl(const char *fmt, ...)
 
 	kfifo_put(tcpw.fifo, tbuf, len);
 	wake_up(&tcpw.wait);
-}
+} __attribute__ ((format (printf, 1, 2)));
+
 
 /*
  * Hook inserted to be called before each receive packet.