Bug#525389: vpnc: MTU calculation fails when default-route is missing

2010-05-20 Thread Chris
Package: vpnc
Version: 0.5.3r449-2
Severity: normal

Sorry, i had some problems sending this report via thunderbird. Hope
reportbug works now.

There seems to be the same/similar problem with the vpnc when i'm connected via 
wlan at our university and try to start a vpn connection. When i start the vpnc 
i get this error:

---
Usage: ip link add link DEV [ name ] NAME
   [ txqueuelen PACKETS ]
   [ address LLADDR ]
   [ broadcast LLADDR ]
   [ mtu MTU ]
   type TYPE [ ARGS ]
   ip link delete DEV type TYPE [ ARGS ]

   ip link set DEVICE [ { up | down } ]
  [ arp { on | off } ]
  [ dynamic { on | off } ]
  [ multicast { on | off } ]
  [ allmulticast { on | off } ]
  [ promisc { on | off } ]
  [ trailers { on | off } ]
  [ txqueuelen PACKETS ]
  [ name NEWNAME ]
  [ address LLADDR ]
  [ broadcast LLADDR ]
  [ mtu MTU ]
  [ netns PID ]
  [ alias NAME ]
   ip link show [ DEVICE ]

TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | can }
SIOCSIFMTU: invalid argument
-

and the mtu of tun0 is set to 1500. When i comment out the whole if [-n 
%INTERNAL_IP4_MTU block and just use MTU=1412 the error is gone.

After that i have tried Philipp solution and it works too, no error is shown 
and the mtu is set to 1412.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-12-atom (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages vpnc depends on:
ii  libc6 2.10.2-6   Embedded GNU C Library: Shared lib
ii  libgcrypt11   1.4.5-2LGPL Crypto library - runtime libr
ii  libgnutls26   2.8.6-1the GNU TLS library - runtime libr

Versions of packages vpnc recommends:
ii  iproute   20100224-5 networking and traffic control too

Versions of packages vpnc suggests:
pn  resolvconfnone (no description available)

-- Configuration Files:
/etc/vpnc/example.conf [Errno 13] Keine Berechtigung: u'/etc/vpnc/example.conf'
/etc/vpnc/vpnc-script [Errno 13] Keine Berechtigung: u'/etc/vpnc/vpnc-script'

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#525389: vpnc: MTU calculation fails when default-route is missing

2009-04-24 Thread Philipp Matthias Hahn
Package: vpnc
Version: 0.5.1r334-1
Severity: normal

In my environemnt our DHCP returns a bogus-default-route, which I remove
in a custom /etc/dhcp3/dhclient-enter-hooks.d/ script, because the
gateway blocks most outbound traffic expect than a very limited subset
of 134.106.*. My script bascially does this by doing

case $reason,`iwgetid -s $interface` in
BOUND,vpnhrzb|BOUND,uniOLwlan)
vpn_gw=$new_routers
unset new_routers

This breaks the MTU calculation in /etc/vpnc/vpnc-script, because in 
do_ifconfig()
DEV=$($IPROUTE route | grep ^default | sed 's/^.* dev 
\([[:alnum:]-]\+\).*$/\1/')
returns no default route and thus DEV is empty.

Since the script is not really interested in the MTU to the
default-gateway but to the VPN-gateway, I propose to change the function
to something like the following: ip route get returns the mtu used to
reach the VPN-gateway; directly use that value and substract 88 for the
IPSec-headers. If that fails, fall back to 1412.

do_ifconfig() {
test -n $IPROUTE \
 MTU=$(($($IPROUTE route get $VPNGATEWAY | sed -ne 's/^.* 
mtu \([[:digit:]]\+\).*$/\1/p') - 88)) \
|| MTU=1412

ifconfig $TUNDEV inet $INTERNAL_IP4_ADDRESS $ifconfig_syntax_ptp 
$INTERNAL_IP4_ADDRESS netmask ${INTERNAL_IP4_NETMASK:-255.255.255.255} mtu 
${MTU} up
}

(For sid (untested:)
do_ifconfig() {
if [ -n $INTERNAL_IP4_MTU ]; then
MTU=$INTERNAL_IP4_MTU
else
test -n $IPROUTE  MTU=$(($($IPROUTE route get $VPNGATEWAY 
| sed -ne 's/^.* mtu \([[:digit:]]\+\).*$/\1/p') - 88)) || MTU=1412
fi

# Point to point interface require a netmask of 255.255.255.255 on some 
systems
ifconfig $TUNDEV inet $INTERNAL_IP4_ADDRESS $ifconfig_syntax_ptp 
$INTERNAL_IP4_ADDRESS netmask 255.255.255.255 mtu ${MTU} up

if [ -n $INTERNAL_IP4_NETMASK ]; then
set_network_route $INTERNAL_IP4_NETADDR $INTERNAL_IP4_NETMASK 
$INTERNAL_IP4_NETMASKLEN
fi
}

BYtE
Philipp


-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages vpnc depends on:
ii  libc6 2.7-18 GNU C Library: Shared libraries
ii  libgcrypt11   1.4.1-1LGPL Crypto library - runtime libr

Versions of packages vpnc recommends:
ii  iproute   20080725-2 networking and traffic control too
ii  resolvconf1.42   name server information handler

vpnc suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org