Re: masquerading and http

Scottie Shore (sshore@h-207-161-209-012.adsl.escape.ca)
Tue, 22 Jun 1999 11:50:24 -0500 (CDT)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---1463811071-298876915-930070224=:6999
Content-Type: TEXT/PLAIN; charset=US-ASCII

-----BEGIN PGP SIGNED MESSAGE-----

Hi!

For some time now, I've been having problems with the ip_masq_irc module.
Although DCC CHAT worked just fine, DCC SEND wouldn't work at all. I think
I have a fix for it, and I've included it as a kernel patch.

The problem turns out to be that the module expected a single parameter
(filesize) after the address and port parameters. According to the CTCP
spec, this is correct. However, some irc clients (bX and ircII-epic are
confirmed) add extra parameters, like file description or checksum
information.

I've made a couple of modifications to this behaviour:
1) The module no longer looks for the trailing 0x01 ctcp quoting
character; it now looks for the leading quoting character before DCC.
2) Parsing of the packet stops after address and port, as this is the only
part we're really interested in.

I've tested it on my own system, and it appears to work fine. Even though
it's a simple change, I'd like to see at least a couple people try it out.

This is my first attempt at a kernel patch. I believe it's in the proper
format, but any suggestions would be welcome.

The file is also available at
http://www.escape.ca/~sshore/ip_masq_irc.c.patch.gz

Scottie Shore | "Experience is the worst teacher -
<sshore@loki.adsl.escape.ca> | it teaches you what you need to know
| after you needed to know it."
- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
My current valid PGP keys are available on public PGP keyservers:
PGP 2.6.2 0x9DEF8D2F - RSA, PGP 5.0 0xB5E1D683 - DSS

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv

iQCVAwUBN2++4S9e4K2d740vAQHkDgP/VBNvhi/QUK59PiLPksE+9PLwPMjJN5CL
I8ti59fyUgbZ4Z0K12kaMnSkAh+b6CqLmBpuyVXQDej2bvYsaZKRSH+kMvt8bEJN
S2+6/QYKxGg9WAZoTSXsmDAAiXgSWPuBAbA+oyZUoRLKJEg/XGUs5oKpdyUe1f1y
q54cXUhDtbM=
=/B2V
-----END PGP SIGNATURE-----

---1463811071-298876915-930070224=:6999
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ip_masq_irc.c.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.990622115024.6999B@loki.adsl.escape.ca>
Content-Description:

LS0tIGxpbnV4L25ldC9pcHY0L2lwX21hc3FfaXJjLmMJV2VkIEp1biAgMiAw
NDowODo1MyAxOTk5DQorKysgbGludXgvbmV0L2lwdjQvaXBfbWFzcV9pcmMu
YwlTYXQgSnVuIDE5IDIyOjE4OjE1IDE5OTkNCkBAIC0yLDcgKzIsNyBAQA0K
ICAqCQlJUF9NQVNRX0lSQyBpcmMgbWFzcXVlcmFkaW5nIG1vZHVsZQ0KICAq
DQogICoNCi0gKiBWZXJzaW9uOglAKCMpaXBfbWFzcV9pcmMuYyAwLjAzICAg
OTcvMTEvMzANCisgKiBWZXJzaW9uOglAKCMpaXBfbWFzcV9pcmMuYyAwLjA0
ICAgOTkvMDYvMTkNCiAgKg0KICAqIEF1dGhvcjoJSnVhbiBKb3NlIENpYXJs
YW50ZQ0KICAqCQkNCkBAIC0xOCw2ICsxOCw4IEBADQogICoJT2xpdmVyIFdh
Z25lciAJCTogIG1vcmUgSVJDIGNtZHMgcHJvY2Vzc2luZw0KICAqCSAgPHdp
bm11dGVAbHVjaWZlci5ndi5rb3RuZXQub3JnPg0KICAqCUp1YW4gSm9zZSBD
aWFybGFudGUJOiAgcHV0IG5ldyBtcyBlbnRyeSB0byBsaXN0ZW4oKQ0KKyAq
CVNjb3R0aWUgU2hvcmUJCTogIGFkZGVkIHN1cHBvcnQgZm9yIGNsaWVudHMg
dGhhdCBhZGQgZXh0cmEgYXJncw0KKyAqCSAgPHNzaG9yZUBlc2NhcGUuY2E+
DQogICoNCiAgKiBGSVhNRToNCiAgKgktIGRldGVjdCBhbHNvIHByZXZpb3Vz
ICJQUklWTVNHIiBzdHJpbmcgPy4NCkBAIC04MiwxNSArODQsMTQgQEANCiB7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Bj
aGVjayBhcmdzIGNvbnNpc3RlbmN5Pw0KLQkJCQkgKi8NCi0NCi0JCQkJd2hp
bGUoeHRyYV9hcmdzKSB7DQotCQkJCQlpZiAoKmRhdGEgIT0gJyAnKQ0KLQkJ
CQkJCWJyZWFrOw0KLQkJCQkJZGF0YSsrOw0KLQkJCQkJc2ltcGxlX3N0cnRv
dWwoZGF0YSwmZGF0YSwxMCk7DQotCQkJCQl4dHJhX2FyZ3MtLTsNCi0JCQkJ
fQ0KLQ0KLQkJCQlpZiAoeHRyYV9hcmdzICE9IDApIGNvbnRpbnVlOw0KLQ0K
LQkJCQkvKg0KLQkJCQkgKgl0ZXJtaW5hdG9ycy4NCi0JCQkJICovDQotDQot
CQkJCWlmIChkYXRhWzBdICE9IDB4MDEpDQotCQkJCQljb250aW51ZTsNCi0J
CQkJaWYgKGRhdGFbMV0hPSdccicgJiYgZGF0YVsxXSE9J1xuJykNCi0JCQkJ
CWNvbnRpbnVlOw0KLQ0KLQkJCQkvKg0KIAkJCQkgKglOb3cgY3JlYXRlIGFu
IG1hc3F1ZXJhZGUgZW50cnkgZm9yIGl0DQogCQkJCSAqIAltdXN0IHNldCBO
T19EUE9SVCBhbmQgTk9fREFERFIgYmVjYXVzZQ0KIAkJCQkgKgljb25uZWN0
aW9uIGlzIHJlcXVlc3RlZCBieSBhbm90aGVyIGNsaWVudC4NCg==
---1463811071-298876915-930070224=:6999--
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu