[OpenAFS-devel] NAT Patch and bugfix for vlserver
Tommie Gannert
d00-tga@d.kth.se
Wed, 26 Apr 2006 17:48:57 +0200 (MEST)
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.
---559023410-959030623-1146066537=:24279
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Wed, 26 Apr 2006, Jeffrey Hutzelman wrote:
>
>
> On Wednesday, April 26, 2006 05:15:22 PM +0200 Tommie Gannert
> <d00-tga@d.kth.se> wrote:
>
> > Hi!
> >
> > I've been trying to make my behind-NAT AFS-server do backups to
> > a butc-server behind another NAT.
> >
> > That didn't work because the vlserver keeps sending the file servers'
> > first address instead of the one matching the client address. vlnat
> > is a patch against 1.4.0 which
> >
> > 1) Makes vlserver choose the best fs-address based on the number of
> > common address-bits of the RX-client.
>
> Huh? The modern vlserver interfaces return _all_ the addresses of a
> server, not just one. The decision of which address to use should be up to
> the client, which is in a better position to make a decision. It's
> possible that the backup system is still using ancient interfaces that
> refer to fileservers by a single address instead of by UUID; if so, the
> right long-term fix is to make it use the modern interfaces.
First, I'm using 1.4.0 so far. Migrating to 1.4.1 shortly.
Ok, does this have to do with the three variants of
vlentry_to_{,u,n}vldbentry()
in vlprocs.c? But how do i get 'vos listvldb' to list more than one
address, for instance?
If I remember correctly, buserver sends an address. One address. It
seems like a small performance gain, though. butc could be doing the
VLDB lookups in all passes.
I'm not sure if the clients are better off making the decision,
though. If they are behind NAT with the same subnet as the server,
things will get messy. The idea of using common address bits means
it will resort to global address space pretty easily. However, it's
a hack, yes.
Anyway, I don't like butc at all, so maybe I'll just make a new
generation...
> Yup, that's a bug. You should send it to openafs-bugs. Including a patch
> wouldn't hurt, but also shouldn't strictly be necessary in this case, since
> the fix is so obvious.
>
Yeah, and if I had remembered to include the patches... ;)
They'll go to openafs-bugs.
> > (Isn't anyone else using "-syslog"?)
>
> Yes; we've been using -syslog in production for quite a long time. I bet
> not too many people use -rxmaxmtu, though, and this bug should be very
> unlikely to affect people who don't.
>
Actually it affects any command line parameter which is strcmp-parsed
after '-rxmaxmtu' (which was placed in the middle of the list). It
says
if (!strcmp(argv[i], "-rxmaxmtu")) ...
Regards,
Tommie Gannert
---559023410-959030623-1146066537=:24279
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="vlnat-1.4.0.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.58.0604261748570.24279@my.nada.kth.se>
Content-Description:
Content-Disposition: attachment; filename="vlnat-1.4.0.patch"
LS0tIG9wZW5hZnMtMS40LjAvc3JjL3Zsc2VydmVyL3ZscHJvY3MuYwkyMDA1
LTA2LTIxIDIyOjE5OjI5LjAwMDAwMDAwMCArMDIwMA0KKysrIG9wZW5hZnMt
MS40LjAtdmxuYXQvc3JjL3Zsc2VydmVyL3ZscHJvY3MuYwkyMDA2LTA0LTAz
IDIyOjMyOjU4LjAwMDAwMDAwMCArMDIwMA0KQEAgLTQyOSwxMSArNDI5LDEx
IEBADQogICAgIH0NCiAgICAgLyogQ29udmVydCBmcm9tIHRoZSBpbnRlcm5h
bCB0byBleHRlcm5hbCBmb3JtICovDQogICAgIGlmIChuZXcgPT0gMSkNCi0J
dmxlbnRyeV90b19udmxkYmVudHJ5KCZ0ZW50cnksIChzdHJ1Y3QgbnZsZGJl
bnRyeSAqKWFlbnRyeSk7DQorCXZsZW50cnlfdG9fbnZsZGJlbnRyeSgmdGVu
dHJ5LCAoc3RydWN0IG52bGRiZW50cnkgKilhZW50cnksIHJ4Y2FsbC0+Y29u
bi0+cGVlci0+aG9zdCk7DQogICAgIGVsc2UgaWYgKG5ldyA9PSAyKQ0KLQl2
bGVudHJ5X3RvX3V2bGRiZW50cnkoJnRlbnRyeSwgKHN0cnVjdCB1dmxkYmVu
dHJ5ICopYWVudHJ5KTsNCisJdmxlbnRyeV90b191dmxkYmVudHJ5KCZ0ZW50
cnksIChzdHJ1Y3QgdXZsZGJlbnRyeSAqKWFlbnRyeSwg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