Skip to contentSkip to conversation

Typo's in ip_conntrack_rpc_tcp.c ....

DISCUSSION Mark Vevers 2 participants 2 messages Jun 18, 2004 – Jun 19, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

-----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. [email protected] / [email protected]
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-----

#1 lore raw
Quoted 6 lines · Mark Vevers

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