From 4b246014e42b2ab0ea0736b4bb422132de3fa458 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Wed, 23 Jul 2008 12:06:06 +0000 Subject: Fix Bug 3318 ENHANCEMENT REQUEST: Option to NOT Accept DHCP MTU Offers Below Specified Value - only request for dhcp-option interface-mtu from a dhcp-server for an ethernet interface using dhcp to get IP - do not request for interface-mtu for other interfaces that use dhcp i.e. ethernet vifs and bridges - request for interface-mtu from dhcp-server for ethernet interfaces, only if ethernet mtu not set in CLI --- scripts/vyatta-interfaces.pl | 20 ++++++++++++++++---- templates/interfaces/ethernet/node.tag/mtu/node.def | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 18fbf61..676e196 100644 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -184,6 +184,14 @@ sub is_domain_name_set { return $domainname; } +sub is_ethernet_mtu_set { + my $intf = shift; + my $config = new VyattaConfig; + $config->setLevel("interfaces ethernet $intf"); + my $interface_mtu = undef; + $interface_mtu = $config->returnValue("mtu"); + return $interface_mtu; +} sub dhcp_update_config { my ($conf_file, $intf) = @_; @@ -198,11 +206,15 @@ sub dhcp_update_config { $output .= "\trequest subnet-mask, broadcast-address, routers, domain-name-servers"; my $domainname = is_domain_name_set(); if (!defined($domainname)) { - $output .= ", domain-name;\n"; - } else { - $output .= ";\n"; + $output .= ", domain-name"; + } + if ($intf =~ m/^eth[0-9]+$/) { + my $interface_mtu = is_ethernet_mtu_set($intf); + if (!defined($interface_mtu)) { + $output .= ", interface-mtu"; + } } - + $output .= ";\n"; $output .= "}\n\n"; dhcp_write_file($conf_file, $output); diff --git a/templates/interfaces/ethernet/node.tag/mtu/node.def b/templates/interfaces/ethernet/node.tag/mtu/node.def index 07c102a..74c238a 100644 --- a/templates/interfaces/ethernet/node.tag/mtu/node.def +++ b/templates/interfaces/ethernet/node.tag/mtu/node.def @@ -1,5 +1,5 @@ type: u32 help: Set the Maximum Transmission Unit (MTU) for this interface syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000" -update:expression: "sudo ip link set $VAR(../@) mtu $VAR(@)"; "Error setting MTU on dev $VAR(../@)" -delete:expression: "sudo ip link set $VAR(../@) mtu 1500"; "Error deleting MTU on dev $VAR(../@)" +update:expression: "sudo ip link set $VAR(../@) mtu $VAR(@) && echo $VAR(@) > /tmp/dhclient_mtu_check_$VAR(../@)"; "Error setting MTU on dev $VAR(../@)" +delete:expression: "sudo ip link set $VAR(../@) mtu 1500 && rm -f /tmp/dhclient_mtu_check_$VAR(../@)"; "Error deleting MTU on dev $VAR(../@)" -- cgit v1.2.3 From 1ac0df0545fd2a467cc96a5b09cb6bb69e1430f6 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Wed, 23 Jul 2008 14:45:24 +0000 Subject: Fix bug 3318 dont't create unnecessary temporary files, use already created file in active config to retrieve mtu value --- templates/interfaces/ethernet/node.tag/mtu/node.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/interfaces/ethernet/node.tag/mtu/node.def b/templates/interfaces/ethernet/node.tag/mtu/node.def index 74c238a..07c102a 100644 --- a/templates/interfaces/ethernet/node.tag/mtu/node.def +++ b/templates/interfaces/ethernet/node.tag/mtu/node.def @@ -1,5 +1,5 @@ type: u32 help: Set the Maximum Transmission Unit (MTU) for this interface syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000" -update:expression: "sudo ip link set $VAR(../@) mtu $VAR(@) && echo $VAR(@) > /tmp/dhclient_mtu_check_$VAR(../@)"; "Error setting MTU on dev $VAR(../@)" -delete:expression: "sudo ip link set $VAR(../@) mtu 1500 && rm -f /tmp/dhclient_mtu_check_$VAR(../@)"; "Error deleting MTU on dev $VAR(../@)" +update:expression: "sudo ip link set $VAR(../@) mtu $VAR(@)"; "Error setting MTU on dev $VAR(../@)" +delete:expression: "sudo ip link set $VAR(../@) mtu 1500"; "Error deleting MTU on dev $VAR(../@)" -- cgit v1.2.3 From 59494688f9e791179e0411d4ef9f1622376f22ea Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Jul 2008 14:08:17 -0700 Subject: fix for bug 1130. disable ctrl-c during load command to prevent partial load. --- scripts/vyatta-load-config.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl index ee4a9c4..dfbf575 100755 --- a/scripts/vyatta-load-config.pl +++ b/scripts/vyatta-load-config.pl @@ -28,6 +28,8 @@ use IO::Prompt; use Sys::Syslog qw(:standard :macros); use VyattaConfigLoad; +$SIG{'INT'} = 'IGNORE'; + my $etcdir = $ENV{vyatta_sysconfdir}; my $sbindir = $ENV{vyatta_sbindir}; my $bootpath = $etcdir . "/config"; -- cgit v1.2.3 From e760483667267fdcbb99628e7626873f618cca4d Mon Sep 17 00:00:00 2001 From: rbalocca Date: Mon, 28 Jul 2008 16:28:48 -0700 Subject: Remove spurious error message during install --- debian/vyatta-cfg.postinst.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/vyatta-cfg.postinst.in b/debian/vyatta-cfg.postinst.in index 074d57c..d934b84 100644 --- a/debian/vyatta-cfg.postinst.in +++ b/debian/vyatta-cfg.postinst.in @@ -4,7 +4,7 @@ prefix=@prefix@ sysconfdir=@sysconfdir@ mkdir -m 0775 -p $sysconfdir/config $prefix/config -chgrp vyattacfg $sysconfdir/config $prefix/config +chgrp vyattacfg $sysconfdir/config $prefix/config 2>/dev/null update-rc.d vyatta-ofr defaults 90 >/dev/null # do we want to start vyatta-ofr here in postinst? @@ -19,5 +19,5 @@ if [ "$sysconfdir" != "/etc" ]; then fi # add group for configuration, if not already present: -grep '^vyattacfg:' /etc/group >/dev/null || +grep '^vyattacfg:' /etc/group >&/dev/null || addgroup --system vyattacfg -- cgit v1.2.3 From 556eeaec4e31814fd62d2c1394958ab4e7887e79 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 29 Jul 2008 09:06:30 -0700 Subject: Fix 3505: cli crashes on ipv6net type. --- src/cli_new.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/cli_new.c b/src/cli_new.c index 0b50ccb..d9e1687 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -35,7 +35,7 @@ /* Global vars: */ vtw_path m_path, t_path; -/* Loval vars: */ +/* Local vars: */ static vtw_node *vtw_free_nodes; /* linked via left */ static char val_name[] = VAL_NAME; static int cond1[TOP_COND] ={5, 0,-1,-1, 0, 1, 0, 0}; @@ -43,23 +43,23 @@ static int cond2[TOP_COND] ={5, 0, 1,-1,-1, 1, 1, 0}; static char const *cond_formats[DOMAIN_TYPE] = { 0, - "%u", /* INT_TYPE */ - "%u.%u.%u.%u", /*IPV4_TYPE*/ - "%u.%u.%u.%u/%u", /*IPV4NET_TYPE*/ - 0, - 0, - "%x:%x:%x:%x:%x:%x" /* MACADDR_TYPE */ + "%u", /* INT_TYPE */ + "%u.%u.%u.%u", /* IPV4_TYPE */ + "%u.%u.%u.%u/%u", /* IPV4NET_TYPE */ + "%x:%x:%x:%x:%x:%x:%x:%x", /* IPV6NET */ + "%x:%x:%x:%x:%x:%x:%x:%x/%u", /* IPV6NET_TYPE */ + "%x:%x:%x:%x:%x:%x" /* MACADDR_TYPE */ }; static int cond_format_lens[DOMAIN_TYPE] = { - 0, - 1, /* INT_TYPE */ - 4, /*IPV4_TYPE*/ - 5, /*IPV4NET_TYPE*/ - 0, - 0, - 6 /* MACADDR_TYPE */ + 0, + 1, /* INT_TYPE */ + 4, /* IPV4_TYPE */ + 5, /* IPV4NET_TYPE */ + 16, /* IPV6_TYPE */ + 17, /* IPV6NET_TYPE */ + 6 /* MACADDR_TYPE */ }; static int cli_val_len; -- cgit v1.2.3 From e1cc907f3e29bfedf123c28da24d45f187198ece Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 29 Jul 2008 10:20:06 -0700 Subject: Add ipv6 address to comp_help. --- templates/interfaces/ethernet/node.tag/address/node.def | 1 + templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def | 1 + templates/interfaces/loopback/node.tag/address/node.def | 1 + 3 files changed, 3 insertions(+) diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def index 0ff02c8..d523793 100644 --- a/templates/interfaces/ethernet/node.tag/address/node.def +++ b/templates/interfaces/ethernet/node.tag/address/node.def @@ -7,5 +7,6 @@ delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete allowed: echo "dhcp <>" comp_help:Possible completions: Set the IP address and prefix length + Set the IPv6 address and prefix length dhcp Set the IP address and prefix length via DHCP diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def index cb9cedc..625130a 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def @@ -7,4 +7,5 @@ delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete allowed: echo "dhcp <>" comp_help:Possible completions: Set the IP address and prefix length + Set the IPv6 address and prefix length dhcp Set the IP address and prefix length via DHCP diff --git a/templates/interfaces/loopback/node.tag/address/node.def b/templates/interfaces/loopback/node.tag/address/node.def index 03ead09..9faf664 100644 --- a/templates/interfaces/loopback/node.tag/address/node.def +++ b/templates/interfaces/loopback/node.tag/address/node.def @@ -12,3 +12,4 @@ delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete comp_help:Possible completions: Set the IP address and prefix length + Set the IPv6 address and prefix length -- cgit v1.2.3