Skip to contentSkip to conversation

why not __MOD_DEC_USE_COUNT when we register match failer?

DISCUSSION lepton 2 participants 2 messages Jan 13, 2004 – Jan 21, 2004 netfilter

lore
Share & tools
lore

lepton

author
#0 lore raw

in ipt_state.c (and ipt_helper.c)

There is such code in init funciton
-------------------------------------------
/* NULL if ip_conntrack not a module */
if (ip_conntrack_module)
__MOD_INC_USE_COUNT(ip_conntrack_module);
return

	ipt_register_match(&state_match);

-------------------------------------------

I think if ipt_register_match failed for some reason, the use count of ip_conntrack_module will increase. Is it not a bug?

I thinks perhaps we should use such code:

------------------------------------------------
int ret;
/* NULL if ip_conntrack not a module */
if (ip_conntrack_module)

	__MOD_INC_USE_COUNT(ip_conntrack_module);
ret=ipt_register_match(&state_match);
if(ret)
	__MOD_DEC_USE_COUNT(ip_conntrack_module);

return ret;
------------------------------------------------

#1 lore raw
Quoted 8 lines · lepton

in ipt_state.c (and ipt_helper.c)

There is such code in init funciton
-------------------------------------------
/* NULL if ip_conntrack not a module */
if (ip_conntrack_module)
__MOD_INC_USE_COUNT(ip_conntrack_module);
return

Quoted 5 lines
	ipt_register_match(&state_match);

-------------------------------------------

I think if ipt_register_match failed for some reason, the use count of ip_conntrack_module will increase. Is it not a bug?

yes, I agree.

Quoted 1 line

I thinks perhaps we should use such code:

Would you mind preparing a patch for those fixes?

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie