Dutch blog

My Dutch blog is at http://andre-nl.blogspot.com

31 May 2009

Uploading a photo over IPv6

So, ya know, I have this website,
www.blaatschaap.be. This website
offers IPv6 connectivity. Also, I have
IPv6 connectivity at home. My ISP is
xs4all, and they offer an IPv6 tunnel (proto41).

So, last week, a problem appeared on the
website. It seemed to be impossible to
upload a photo. When I tried to upload
a photo, it just timed-out. I tried to change
some settings on the server, but without
result.

After I started using a sniffer, the true
problem showed itself. The problem wasn't
at the server, but at my home.

Look at the result from the sniffer:

Free Image Hosting at www.ImageShack.us

So, what are we seeing here.
The first three packets show a TCP handshake,
nothing unusual there. Since I am uploading
an image over a HTTP POST, there is a lot of data
to be transferred, which is in the next packet.
In a reply to that packet, we receive a ICMPv6
packet 'too big'. So, that's the problem, the packet
my browser tried to sent was too big. According
to the IPv6 Specs, the client is supposed to send
a smaller packet when it receives a ICMPv6 too big
packet. When looking at what the sniffer shows,
that appears even to be happening, but for some
reason, it still doesn't seem to work.

The MTU, is 1480 for a Proto41 IPv6 tunnel.
The default MTU for Ethernet networks
is 1500, so changing the MTU to 1480 solves the
problem. (see this link)

So, now I've found the problem, and know how to
fix it, it's time to have this fix made permanently.
So, looking for the fist solution:
adding:
pre-up /sbin/ifconfig $IFACE mtu 1480
to my /etc/network/interfaces file. (See this link)

Applying this solution does set the MTU to the
desired value, but also makes IPv6 to stop
working. So, this solution is no option.

The solution that did work is
up ip link set mtu 1480 dev $IFACE
With that line added to my /etc/network/interfaces
file, my IPv6 connectivity works, and my MTU is set,
so I will not generate packets that are too big for
my tunnel. (See this link)

24 May 2009

BlaatSchaap Coding Projects

Lol, so, I got a job as a coder since the
begin of this month, so now I have a
few days off because of
ascension (? hemelvaart, says google translate)
it was 21 may, some christian feast)
Anyways, I got a few days off, so, what am I
doing in my spare time? coding! lol

I started coding some on my IRC bot again.
The design wasn't right the way it should be,
and I moved some code from the IRC class to
the Bot class. Still isn't quite the way I want it,
but it's better now. Hard to separate, what should
be done by the protocol and what by the bot's code.

But I should keep in mind some changes I am planning
to do later. I wish to separete my code into different
libraries, so, it should be possible to use the IRC protocol
class and use it to create an IRC client. Not that I am
planning to do so, but I just want the code to be clean.

Speaking about libraries, I am indeed planning to make
bot plugins also, just to load new commands into the
bot as a library. Not just that, I am also looking at some
stuff about mixing languages. As I am working at a
company that uses Delphi, I suppose my (Object) Pascal
skills to get better. So, I was looking at ways to mix
pascal and c(++) code.

So, there are two pascal compilers available for the
Linux platform. The GNU Pascal compiler and the
FreePascal compiler. Soon it turned out the GNU
compiler didn't support libraries yet, so it fell off,
leaving the FreePascal compiler as the compiler to use.

Well... first I tried if I could just write some function
in Pascal, create an object file, and link it so some
object file from C code, but that fails, since the
pascal code expect the some pascal runtime code.

So, then writing an so file, failed... the compiler kept
complaining about linker errors, and this error
was mentioned on many internet sites as well

Free Pascal Compiler version 2.2.4-1 [2009/05/12] for x86_64
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Linux for x86-64
Compiling t.pas
Linking libt.so
t.pas(17) Error: Can't call the linker, switching to external linking
t.pas(17) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)



So, after trying some stuff, it turned out that adding the
parameter -XX (Smart Linking) to the compiler solves
the problem and generated a usable .so file, that can
be used from C code.

Not only the use of Pascal code is on the new stuff list
for the BlaatBot Project, I have also been looking into
some XML parsing code, to integrate some site stuff
into the bot. I have been using this XML parser to parse
some XML code, and so far I am happy with the results.

The author or that code also offered a possibility for a
BSD-style license, what would be great so I do not have
to worry about having to change my own license and
release my code under a BSD-style license as well, as it
has been in the past. For the moment, it's just, the code
really needs some cleaning up, and when that's done,
it will be released again. For the time being, there is
some ancient code from the project at sourceforge.
Don't look at it, it's ancient and ugly.

20 May 2009

Windows 7 on an MSI Wind?

So, I've been running Windows 7 ever since
the public beta was released. So, first the
beta, later the Release Canditate. And it
ran fine so far. I've been running it first on
my Pentium 4 (1,6 Ghz) and installed it later
on my Athlon64 (2,0 Ghz) too. It works nice
and I had nothing to complain about.

So, today I decided to install it on my laptop,
it's an MSI Wind. Installation went fine, but
very soon, messages about disk corruption
started to pop-up. After running chkdsk,
the problems returned immediately.
It seems Windows 7 is corrupting it's own
file system.

A Windows Vista beta also did something like
this on my old laptop. I don't know, but
Windows 7 runs without any problem on
my desktop computers, but it hates my laptop.