[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

ipv6 support for rpm



Hi,

I'm sending IPv4/IPv6 patch for rpm. It enables IPv4/6 communication
with http and ftp servers (for ftp it can use EPSV defined in RFC2428
and standard PASV). Also it enables RFC2732 URL support for IP addresses.

Support for IPv6 requires getaddrinfo() and getnameinfo() functions
and struct sockaddr_storage (from RFC2553). Without getaddrinfo() you can't
play with ipv6, but EPSV with IPv4 still works in such case. Without
getnameinfo() you even can't play with EPSV -- only PASV will work.

When getaddrinfo() is available and you use dns names then tcpConnect()
will try to connect using all addresses of specified name available in DNS
(this applies to ftpReq(), too).

Simple IPv4 session:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug ftp://192.168.0.101/test.src.rpm
Retrieving ftp://192.168.0.101/test.src.rpm
++ connect 192.168.0.101:21 on fdno 3
<- 220 dark.misiek.eu.org FTP server (Version 6.5/OpenBSD, linux port 0.3.2) ready.
-> USER anonymous
<- 331 Guest login ok, type your name as password.
-> PASS misiek@
<- 230 Guest login ok, access restrictions apply.
-> TYPE I
<- 200 Type set to I.
-> SIZE /test.src.rpm
<- 213 12977
-> EPSV
<- 229 Entering Extended Passive Mode (|||1083|)
-> RETR /test.src.rpm
<- 150 Opening BINARY mode data connection for '/test.src.rpm' (12977 bytes).
<- 226 Transfer complete.
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

and IPv6 session:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug ftp://[3ffe:8010:12::10]/test.src.rpm
Retrieving ftp://[3ffe:8010:12::10]/test.src.rpm
++ connect [3ffe:8010:12::10]:21 on fdno 3
<- 220 dark.misiek.eu.org FTP server (Version 6.5/OpenBSD, linux port 0.3.2) ready.
-> USER anonymous
<- 331 Guest login ok, type your name as password.
-> PASS misiek@
<- 230 Guest login ok, access restrictions apply.
-> TYPE I
<- 200 Type set to I.
-> SIZE /test.src.rpm
<- 213 12977
-> EPSV
<- 229 Entering Extended Passive Mode (|||1086|)
-> RETR /test.src.rpm
<- 150 Opening BINARY mode data connection for '/test.src.rpm' (12977 bytes).
<- 226 Transfer complete.
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

And now session with server which doesn't understand EPSV:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug ftp://192.168.0.101/test.src.rpm
Retrieving ftp://192.168.0.101/test.src.rpm
++ connect 192.168.0.101:21 on fdno 3
<- 220 ProFTPD PLD Linux Server (ProFTPD) [dark.misiek.eu.org]
-> USER anonymous
<- 331 Anonymous login ok, send your complete email address as your password.
-> PASS misiek@
<- 230 Anonymous access granted, restrictions apply.
-> TYPE I
<- 200 Type set to I.
-> SIZE /test.src.rpm
<- 213 12977
-> EPSV
<- 500 EPSV not understood.
-> PASV
<- 227 Entering Passive Mode (192,168,0,101,4,52).
-> RETR /test.src.rpm
<- 150 Opening BINARY mode data connection for /test.src.rpm (12977 bytes).
<- 226 Transfer complete.
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

And via HTTP:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug http://192.168.0.101/test.src.rpm
Retrieving http://192.168.0.101/test.src.rpm
++ connect [192.168.0.101]:80 on fdno 3
-> GET /test.src.rpm HTTP/1.0
User-Agent: rpm/3.0.5
Host: 192.168.0.101:80
Accept: text/plain

<- HTTP/1.1 200 OK
<- Date: Wed, 13 Sep 2000 19:18:43 GMT
<- Server: Apache/1.3.12 (Unix)  (PLD/Linux)
<- Last-Modified: Sun, 27 Aug 2000 14:59:34 GMT
<- ETag: "e4e9-32b1-39a92cd6"
<- Accept-Ranges: bytes
<- Content-Length: 12977
<- Connection: close
<- Content-Type: application/x-rpm
<-
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

and over IPv6:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug http://[3ffe:8010:12::10]/test.src.rpm
Retrieving http://[3ffe:8010:12::10]/test.src.rpm
++ connect [3ffe:8010:12::10]:80 on fdno 3
-> GET /test.src.rpm HTTP/1.0
User-Agent: rpm/3.0.5
Host: [3ffe:8010:12::10]:80
Accept: text/plain

<- HTTP/1.1 200 OK
<- Date: Wed, 13 Sep 2000 19:38:28 GMT
<- Server: Apache/1.3.12 (Unix)  (PLD/Linux)
<- Last-Modified: Sun, 27 Aug 2000 14:59:34 GMT
<- ETag: "e4e9-32b1-39a92cd6"
<- Accept-Ranges: bytes
<- Content-Length: 12977
<- Connection: close
<- Content-Type: application/x-rpm
<-
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

Note some IPv6 patches for apache are broken. Apache with these patches
don't allow to specify port number in Host: field (when Host contains
IPv6 colon notation address), so you need fix apache patch, modify httpReq()
to don't sent port number in that field or use DNS names :-)

-- 
Arkadiusz Miskiewicz, PLD GNU/Linux Team


-- 
Arkadiusz Miśkiewicz         http://www.misiek.eu.org/ipv6/
PLD GNU/Linux [IPv6 enabled]    http://www.pld.org.pl/
Hi,

I'm sending IPv4/IPv6 patch for rpm. It enables IPv4/6 communication
with http and ftp servers (for ftp it can use EPSV defined in RFC2428
and standard PASV). Also it enables RFC2732 URL support for IP addresses.

Support for IPv6 requires getaddrinfo() and getnameinfo() functions
and struct sockaddr_storage (from RFC2553). Without getaddrinfo() you can't
play with ipv6, but EPSV with IPv4 still works in such case. Without
getnameinfo() you even can't play with EPSV -- only PASV will work.

When getaddrinfo() is available and you use dns names then tcpConnect()
will try to connect using all addresses of specified name available in DNS
(this applies to ftpReq(), too).

Simple IPv4 session:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug ftp://192.168.0.101/test.src.rpm
Retrieving ftp://192.168.0.101/test.src.rpm
++ connect 192.168.0.101:21 on fdno 3
<- 220 dark.misiek.eu.org FTP server (Version 6.5/OpenBSD, linux port 0.3.2) ready.
-> USER anonymous
<- 331 Guest login ok, type your name as password.
-> PASS misiek@
<- 230 Guest login ok, access restrictions apply.
-> TYPE I
<- 200 Type set to I.
-> SIZE /test.src.rpm
<- 213 12977
-> EPSV
<- 229 Entering Extended Passive Mode (|||1083|)
-> RETR /test.src.rpm
<- 150 Opening BINARY mode data connection for '/test.src.rpm' (12977 bytes).
<- 226 Transfer complete.
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

and IPv6 session:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug ftp://[3ffe:8010:12::10]/test.src.rpm
Retrieving ftp://[3ffe:8010:12::10]/test.src.rpm
++ connect [3ffe:8010:12::10]:21 on fdno 3
<- 220 dark.misiek.eu.org FTP server (Version 6.5/OpenBSD, linux port 0.3.2) ready.
-> USER anonymous
<- 331 Guest login ok, type your name as password.
-> PASS misiek@
<- 230 Guest login ok, access restrictions apply.
-> TYPE I
<- 200 Type set to I.
-> SIZE /test.src.rpm
<- 213 12977
-> EPSV
<- 229 Entering Extended Passive Mode (|||1086|)
-> RETR /test.src.rpm
<- 150 Opening BINARY mode data connection for '/test.src.rpm' (12977 bytes).
<- 226 Transfer complete.
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

And now session with server which doesn't understand EPSV:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug ftp://192.168.0.101/test.src.rpm
Retrieving ftp://192.168.0.101/test.src.rpm
++ connect 192.168.0.101:21 on fdno 3
<- 220 ProFTPD PLD Linux Server (ProFTPD) [dark.misiek.eu.org]
-> USER anonymous
<- 331 Anonymous login ok, send your complete email address as your password.
-> PASS misiek@
<- 230 Anonymous access granted, restrictions apply.
-> TYPE I
<- 200 Type set to I.
-> SIZE /test.src.rpm
<- 213 12977
-> EPSV
<- 500 EPSV not understood.
-> PASV
<- 227 Entering Passive Mode (192,168,0,101,4,52).
-> RETR /test.src.rpm
<- 150 Opening BINARY mode data connection for /test.src.rpm (12977 bytes).
<- 226 Transfer complete.
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

And via HTTP:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug http://192.168.0.101/test.src.rpm
Retrieving http://192.168.0.101/test.src.rpm
++ connect [192.168.0.101]:80 on fdno 3
-> GET /test.src.rpm HTTP/1.0
User-Agent: rpm/3.0.5
Host: 192.168.0.101:80
Accept: text/plain

<- HTTP/1.1 200 OK
<- Date: Wed, 13 Sep 2000 19:18:43 GMT
<- Server: Apache/1.3.12 (Unix)  (PLD/Linux)
<- Last-Modified: Sun, 27 Aug 2000 14:59:34 GMT
<- ETag: "e4e9-32b1-39a92cd6"
<- Accept-Ranges: bytes
<- Content-Length: 12977
<- Connection: close
<- Content-Type: application/x-rpm
<-
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

and over IPv6:
[misiek@dark rpm-3.0.5]$ LC_ALL=C ./rpm -Uvh --ftpdebug http://[3ffe:8010:12::10]/test.src.rpm
Retrieving http://[3ffe:8010:12::10]/test.src.rpm
++ connect [3ffe:8010:12::10]:80 on fdno 3
-> GET /test.src.rpm HTTP/1.0
User-Agent: rpm/3.0.5
Host: [3ffe:8010:12::10]:80
Accept: text/plain

<- HTTP/1.1 200 OK
<- Date: Wed, 13 Sep 2000 19:38:28 GMT
<- Server: Apache/1.3.12 (Unix)  (PLD/Linux)
<- Last-Modified: Sun, 27 Aug 2000 14:59:34 GMT
<- ETag: "e4e9-32b1-39a92cd6"
<- Accept-Ranges: bytes
<- Content-Length: 12977
<- Connection: close
<- Content-Type: application/x-rpm
<-
ziptool                     ##################################################
[misiek@dark rpm-3.0.5]$

Note some IPv6 patches for apache are broken. Apache with these patches
don't allow to specify port number in Host: field (when Host contains
IPv6 colon notation address), so you need fix apache patch, modify httpReq()
to don't sent port number in that field or use DNS names :-)

-- 
Arkadiusz Miskiewicz, PLD GNU/Linux Team

Attachment: rpm-3.0.5-ipv6-20000914.patch.gz
Description: Binary data


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []