All of lore.kernel.org
 help / color / mirror / Atom feed
* Typo's in ip_conntrack_rpc_tcp.c ....
@ 2004-06-18 14:49 Mark Vevers
  2004-06-18 15:13 ` Antony Stone
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Vevers @ 2004-06-18 14:49 UTC (permalink / raw)
  To: netfilter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The following 'bug' is currently only a textual typo due to the structures
actually used - if the structures change it could cause a real bug ....

In the init for ip_conntrack_rpc_tcp the code sets the ports for 

  rpc_helpers[port].mask.dst.u.udp.port = htons(0x0);

with  
  rpc_helpers[port].tuple.dst.protonum = IPPROTO_TCP;

i.e. it's setting the udp port for a TCP packet.   In this instance it doesn't 
matter becase the tuple structure is a union and uses the same type - 
from ip_conntrack_tuple.h:
			struct {
                                u_int16_t port;
                        } tcp;
                        struct {
                                u_int16_t port;
                        } udp;

Here's the diff:
Index: ip_conntrack_rpc_tcp.c
===================================================================
RCS file: 
/cvspublic/patch-o-matic-ng/rpc/linux/net/ipv4/netfilter/ip_conntrack_rpc_tcp.c,v
retrieving revision 1.2
diff -U2 -r1.2 ip_conntrack_rpc_tcp.c
- --- ip_conntrack_rpc_tcp.c      5 May 2004 16:39:37 -0000       1.2
+++ ip_conntrack_rpc_tcp.c      18 Jun 2004 14:34:18 -0000
@@ -451,7 +451,7 @@

                /* RPC can come from ports 0:65535 to ports[port] (111) */
- -               rpc_helpers[port].tuple.src.u.udp.port = htons(ports[port]);
- -               rpc_helpers[port].mask.src.u.udp.port = htons(0xffff);
- -               rpc_helpers[port].mask.dst.u.udp.port = htons(0x0);
+               rpc_helpers[port].tuple.src.u.tcp.port = htons(ports[port]);
+               rpc_helpers[port].mask.src.u.tcp.port = htons(0xffff);
+               rpc_helpers[port].mask.dst.u.tcp.port = htons(0x0);

                rpc_helpers[port].help = help;


- -- 
Mark Vevers.    mark@ifl.net / mark@vevers.net
Principal Internet Engineer, Internet for Learning,
Research Machines Plc. (AS5503)
- --
GPG Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xB08F3CA3
Fingerprint: 85BA 30C4 9EC8 1792 4C8C   C31E 58B5 3D1C B08F 3CA3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFA0wDuWLU9HLCPPKMRAmxlAJ9qrku1Ykvjmv0QeUeyVoM8UFri8QCfXV8S
3whpD5fwsG/PpTWJHGVMqXg=
=sCOn
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Typo's in ip_conntrack_rpc_tcp.c ....
@ 2004-06-18 15:06 Mark Vevers
  2004-06-19 20:33 ` Patrick McHardy
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Vevers @ 2004-06-18 15:06 UTC (permalink / raw)
  To: netfilter-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The following 'bug' is currently only a textual typo due to the structures
actually used - if the structures change it could cause a real bug ....

In the init for ip_conntrack_rpc_tcp the code sets the ports for

  rpc_helpers[port].mask.dst.u.udp.port = htons(0x0);

with
  rpc_helpers[port].tuple.dst.protonum = IPPROTO_TCP;

i.e. it's setting the udp port for a TCP packet.   In this instance it
 doesn't matter becase the tuple structure is a union and uses the same type
 - from ip_conntrack_tuple.h:
			struct {
                                u_int16_t port;
                        } tcp;
                        struct {
                                u_int16_t port;
                        } udp;

Here's the diff:
Index: ip_conntrack_rpc_tcp.c
===================================================================
RCS file:
/cvspublic/patch-o-matic-ng/rpc/linux/net/ipv4/netfilter/ip_conntrack_rpc_tcp.c,v
retrieving revision 1.2
diff -U2 -r1.2 ip_conntrack_rpc_tcp.c
- --- ip_conntrack_rpc_tcp.c      5 May 2004 16:39:37 -0000       1.2
+++ ip_conntrack_rpc_tcp.c      18 Jun 2004 14:34:18 -0000
@@ -451,7 +451,7 @@

                /* RPC can come from ports 0:65535 to ports[port] (111) */
- -               rpc_helpers[port].tuple.src.u.udp.port = htons(ports[port]);
- -               rpc_helpers[port].mask.src.u.udp.port = htons(0xffff);
- -               rpc_helpers[port].mask.dst.u.udp.port = htons(0x0);
+               rpc_helpers[port].tuple.src.u.tcp.port = htons(ports[port]);
+               rpc_helpers[port].mask.src.u.tcp.port = htons(0xffff);
+               rpc_helpers[port].mask.dst.u.tcp.port = htons(0x0);

                rpc_helpers[port].help = help;


- -- 
Mark Vevers.    mark@ifl.net / mark@vevers.net
Principal Internet Engineer, Internet for Learning,
Research Machines Plc. (AS5503)
- --
GPG Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xB08F3CA3
Fingerprint: 85BA 30C4 9EC8 1792 4C8C   C31E 58B5 3D1C B08F 3CA3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFA0wT5WLU9HLCPPKMRAoWjAJ0X3E8rXHGOHMDNEuilsDeu4eSLcgCfecLn
UYMmsHany+dpXuz08LWUXQw=
=trh0
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Typo's in ip_conntrack_rpc_tcp.c ....
  2004-06-18 14:49 Mark Vevers
@ 2004-06-18 15:13 ` Antony Stone
  0 siblings, 0 replies; 4+ messages in thread
From: Antony Stone @ 2004-06-18 15:13 UTC (permalink / raw)
  To: netfilter

On Friday 18 June 2004 3:49 pm, Mark Vevers wrote:

> The following 'bug' is currently only a textual typo due to the structures
> actually used - if the structures change it could cause a real bug ....

Looks like a good spot you've made there.

I suggest you send it to the netfilter developers' list, however, as I don't 
think they always manage to keep up with everything on this users' list.

Regards,

Antony.

-- 
Microsoft may sell more software than any other company, but McDonald's sell 
more burgers than any other company, and I think the other similarities are 
obvious...

                                                     Please reply to the list;
                                                           please don't CC me.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Typo's in ip_conntrack_rpc_tcp.c ....
  2004-06-18 15:06 Typo's in ip_conntrack_rpc_tcp.c Mark Vevers
@ 2004-06-19 20:33 ` Patrick McHardy
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2004-06-19 20:33 UTC (permalink / raw)
  To: mark; +Cc: netfilter-devel

Mark Vevers wrote:

> In the init for ip_conntrack_rpc_tcp the code sets the ports for
> 
>   rpc_helpers[port].mask.dst.u.udp.port = htons(0x0);
> 
> with
>   rpc_helpers[port].tuple.dst.protonum = IPPROTO_TCP;

Patch applied, thanks.

Regards
Patrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-19 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-18 15:06 Typo's in ip_conntrack_rpc_tcp.c Mark Vevers
2004-06-19 20:33 ` Patrick McHardy
  -- strict thread matches above, loose matches on Subject: below --
2004-06-18 14:49 Mark Vevers
2004-06-18 15:13 ` Antony Stone

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.