From patchwork Fri Apr 17 14:19:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 26121 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id EB2E7B7079 for ; Fri, 17 Apr 2009 23:20:01 +1000 (EST) Received: by ozlabs.org (Postfix) id DA5BFDE0D3; Fri, 17 Apr 2009 23:20:01 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 7F116DE0D2 for ; Fri, 17 Apr 2009 23:20:01 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758939AbZDQNTz (ORCPT ); Fri, 17 Apr 2009 09:19:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757206AbZDQNTz (ORCPT ); Fri, 17 Apr 2009 09:19:55 -0400 Received: from earthlight.etchedpixels.co.uk ([81.2.110.250]:37307 "EHLO t61.ukuu.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756821AbZDQNTy (ORCPT ); Fri, 17 Apr 2009 09:19:54 -0400 Received: from t61.ukuu.org.uk (t61.ukuu.org.uk [127.0.0.1]) by t61.ukuu.org.uk (8.14.3/8.14.3) with ESMTP id n3HEJaa9015135; Fri, 17 Apr 2009 15:19:36 +0100 From: Alan Cox Subject: [PATCH] ax25: proc uid file misses header To: davem@davemloft.net, netdev@vger.kernel.org Date: Fri, 17 Apr 2009 15:19:36 +0100 Message-ID: <20090417141928.15105.59684.stgit@t61.ukuu.org.uk> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This has been broken for a while. I happened to catch it testing because one app "knew" that the top line of the calls data was the policy line and got confused. Put the header back. Signed-off-by: Alan Cox --- net/ax25/ax25_uid.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index 57aeba7..d5cfbcf 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c @@ -148,9 +148,13 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) { struct ax25_uid_assoc *pt; struct hlist_node *node; - int i = 0; + int i = 1; read_lock(&ax25_uid_lock); + + if (*pos == 0) + return SEQ_START_TOKEN; + ax25_uid_for_each(pt, node, &ax25_uid_list) { if (i == *pos) return pt; @@ -162,8 +166,10 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - - return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, + if (v == SEQ_START_TOKEN) + return ax25_uid_list.first; + else + return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, ax25_uid_assoc, uid_node); }