* SNMP conntrack module a la netbios_ns
@ 2009-12-04 9:53 Tim Waugh
2009-12-04 10:20 ` Patrick McHardy
0 siblings, 1 reply; 3+ messages in thread
From: Tim Waugh @ 2009-12-04 9:53 UTC (permalink / raw)
To: netfilter
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]
Hi,
I maintain the printing stack for Fedora and Red Hat Enterprise Linux,
and I've become aware of a need for another conntrack module very
similar to nf_conntrack_netbios_ns.
When CUPS searches for network printers it issues an SNMP broadcast
query from a random source port and to the SNMP destination port, and
waits for (unicast) replies from printers, following up each reply with
a set of unicast SNMP queries.
The problem is that the iptables rules discard the replies to the
initial broadcast query.
It looks like a conntrack module is what's needed to fix the problem,
and the netbios_ns module very nearly solves it: the only changes I can
see would be needed are the port number and the maximum number of
expected replies.
Is this something that warrants a more generic module so that code can
be shared between them, or would it be better to just copy the code and
make the changes?
Thanks,
Tim.
*/
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: SNMP conntrack module a la netbios_ns
2009-12-04 9:53 SNMP conntrack module a la netbios_ns Tim Waugh
@ 2009-12-04 10:20 ` Patrick McHardy
2009-12-04 10:22 ` Patrick McHardy
0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2009-12-04 10:20 UTC (permalink / raw)
To: Tim Waugh; +Cc: netfilter, Netfilter Development Mailinglist
[netfilter-devel is the correct list for development questions, CCed]
Tim Waugh wrote:
> I maintain the printing stack for Fedora and Red Hat Enterprise Linux,
> and I've become aware of a need for another conntrack module very
> similar to nf_conntrack_netbios_ns.
>
> When CUPS searches for network printers it issues an SNMP broadcast
> query from a random source port and to the SNMP destination port, and
> waits for (unicast) replies from printers, following up each reply with
> a set of unicast SNMP queries.
>
> The problem is that the iptables rules discard the replies to the
> initial broadcast query.
>
> It looks like a conntrack module is what's needed to fix the problem,
> and the netbios_ns module very nearly solves it: the only changes I can
> see would be needed are the port number and the maximum number of
> expected replies.
Yes, I think Samir Bellabes mentioned this as well back when I added
that module.
> Is this something that warrants a more generic module so that code can
> be shared between them, or would it be better to just copy the code and
> make the changes?
The best solution would be to add generic broadcast tracking, the
use of expectations for this is a bit of abuse.
The second best choice I guess would be to move the help() function
to a shared module and generalize it so it can be used for both.
Basically I think it would come down to changing:
exp->tuple.dst.u.udp.port = htons(NMBD_PORT);
to:
struct nf_conn_help *help = nfct_help(ct);
...
exp->tuple.dst.u.udp.port = help->helper->tuple.src.u.udp.port;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: SNMP conntrack module a la netbios_ns
2009-12-04 10:20 ` Patrick McHardy
@ 2009-12-04 10:22 ` Patrick McHardy
0 siblings, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2009-12-04 10:22 UTC (permalink / raw)
To: Tim Waugh; +Cc: netfilter, Netfilter Development Mailinglist
Patrick McHardy wrote:
> [netfilter-devel is the correct list for development questions, CCed]
>
> Tim Waugh wrote:
>> I maintain the printing stack for Fedora and Red Hat Enterprise Linux,
>> and I've become aware of a need for another conntrack module very
>> similar to nf_conntrack_netbios_ns.
>>
>> When CUPS searches for network printers it issues an SNMP broadcast
>> query from a random source port and to the SNMP destination port, and
>> waits for (unicast) replies from printers, following up each reply with
>> a set of unicast SNMP queries.
>>
>> The problem is that the iptables rules discard the replies to the
>> initial broadcast query.
>>
>> It looks like a conntrack module is what's needed to fix the problem,
>> and the netbios_ns module very nearly solves it: the only changes I can
>> see would be needed are the port number and the maximum number of
>> expected replies.
>
> Yes, I think Samir Bellabes mentioned this as well back when I added
> that module.
>
>> Is this something that warrants a more generic module so that code can
>> be shared between them, or would it be better to just copy the code and
>> make the changes?
>
> The best solution would be to add generic broadcast tracking, the
> use of expectations for this is a bit of abuse.
>
> The second best choice I guess would be to move the help() function
> to a shared module and generalize it so it can be used for both.
> Basically I think it would come down to changing:
>
> exp->tuple.dst.u.udp.port = htons(NMBD_PORT);
>
> to:
>
> struct nf_conn_help *help = nfct_help(ct);
> ...
> exp->tuple.dst.u.udp.port = help->helper->tuple.src.u.udp.port;
There is one problem however, we already have the SNMP NAT helper,
which also registers for the SNMP port. Those would clash if you
add a second registration.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-04 10:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04 9:53 SNMP conntrack module a la netbios_ns Tim Waugh
2009-12-04 10:20 ` Patrick McHardy
2009-12-04 10:22 ` Patrick McHardy
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).