diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-29 15:53:49 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-29 15:53:49 -0700 |
commit | 51dabae40799358785a147b3447b7075e7fae22b (patch) | |
tree | f0eb1f6b3c224edfb794443f9b9ba19d650157c4 | |
parent | 5cfca8801a52bf8e9421417f82a4cee6cfe8653e (diff) | |
parent | e1cc907f3e29bfedf123c28da24d45f187198ece (diff) | |
download | vyatta-cfg-51dabae40799358785a147b3447b7075e7fae22b.tar.gz vyatta-cfg-51dabae40799358785a147b3447b7075e7fae22b.zip |
Merge branch 'islavista' of suva.vyatta.com:/git/vyatta-cfg into islavista
-rw-r--r-- | debian/vyatta-cfg.postinst.in | 4 | ||||
-rw-r--r-- | scripts/vyatta-interfaces.pl | 20 | ||||
-rwxr-xr-x | scripts/vyatta-load-config.pl | 2 | ||||
-rw-r--r-- | src/cli_new.c | 28 | ||||
-rw-r--r-- | templates/interfaces/ethernet/node.tag/address/node.def | 1 | ||||
-rw-r--r-- | templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def | 1 | ||||
-rw-r--r-- | templates/interfaces/loopback/node.tag/address/node.def | 1 |
7 files changed, 37 insertions, 20 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 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/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"; 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; 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: <x.x.x.x/x> Set the IP address and prefix length + <h:h:h:h:h:h:h:h/x> 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: <x.x.x.x/x> Set the IP address and prefix length + <h:h:h:h:h:h:h:h/x> 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: <x.x.x.x/x> Set the IP address and prefix length + <h:h:h:h:h:h:h:h/x> Set the IPv6 address and prefix length |