net/ipv4/ipmr.c fixes
Subsystems (3)
PATCH 1/1 net/ipv4/ipmr.c fixes
- pim_protocol warning fix
- ipmr_vif_open() and ipmr_mfc_open() allocates the memory, so it should use seq_release_private().
- ipmr_mfc_seq_xxx is using it->cache, in order to control whether unlock should be do or not, but it->cache was not initialized in ipmr_mfc_seq_start(). So it can point the previous state if user did seek(). This become to the cause of twice unlock.
---
net/ipv4/ipmr.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
net/ipv4/ipmr.c renamed from net/ipv4/ipmr.c~ipmr-fixes +7 -3
@@ -109,7 +109,9 @@ static int ip_mr_forward(struct sk_buffstatic int ipmr_cache_report (struct sk_buff *pkt,vifi_t vifi,int assert);static int ipmr_fill_mroute (struct sk_buff *skb,struct mfc_cache *c,struct rtmsg *rtm); +#ifdef CONFIG_IP_PIMSM_V2 static struct net_protocol pim_protocol; +#endif static struct timer_list ipmr_expire_timer;
@@ -1702,7 +1704,7 @@ static struct file_operations ipmr_vif_f .open = ipmr_vif_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = seq_release_private, };struct ipmr_mfc_iter {
@@ -1737,6 +1739,9 @@ static struct mfc_cache *ipmr_mfc_seq_idstatic void *ipmr_mfc_seq_start (struct seq_file *seq,loff_t *pos) { +struct ipmr_mfc_iter *it = seq->private; + it->cache =NULL ; + it->ct =0 ;return *pos ?ipmr_mfc_seq_idx (seq->private, *pos -1 ) :SEQ_START_TOKEN ; }
@@ -1846,7 +1851,6 @@ static int ipmr_mfc_open(struct inode *iif (rc) goto out_kfree; -memset (s,0 ,sizeof (*s)); seq = file->private_data; seq->private = s; out:
@@ -1862,7 +1866,7 @@ static struct file_operations ipmr_mfc_f .open = ipmr_mfc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = seq_release_private, };#endif
_
Signature · 1 line
OGAWA Hirofumi <[email protected]>
Quoted 9 lines · On Thu, 08 Jul 2004 04:25:26 +0900 OGAWA Hirofumi…
-
pim_protocolwarning fix-
ipmr_vif_open()andipmr_mfc_open()allocates the memory, so it should useseq_release_private().-
ipmr_mfc_seq_xxxis usingit->cache, in order to control whether unlock should be do or not, butit->cachewas not initialized inipmr_mfc_seq_start(). So it can point the previous state if user didseek(). This become to the cause of twice unlock.
Looks good, patch applied. Thanks!