]> git.pld-linux.org Git - packages/dhcp.git/commitdiff
- updated to 4.0.0; handle ipv6, too
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 3 Feb 2008 19:12:12 +0000 (19:12 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dhcp-dhclient.script.patch -> 1.3

dhcp-dhclient.script.patch

index ce71dd296a11cce0f4739e997a73ab892fe0a764..29742551db09005052283627a878311219ccac8c 100644 (file)
@@ -1,6 +1,6 @@
 --- dhcp-3.1.0a3/client/scripts/linux.orig     2006-07-22 04:24:16.000000000 +0200
 +++ dhcp-3.1.0a3/client/scripts/linux  2007-04-16 17:25:06.000000000 +0200
-@@ -1,208 +1,227 @@
+@@ -1,290 +1,302 @@
 -#!/bin/bash
 +#!/bin/sh
  # dhclient-script for Linux. Dan Halbert, March, 1997.
@@ -26,6 +26,9 @@
 -
 -# 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
 -# of the $1 in its args.
+-
+-# 'ip' just looks too weird.  /sbin/ip looks less weird.
+-ip=/sbin/ip
 +calc_prefix()
 +{
 +      local old_IFS=$IFS
 -    done
 -
 -    mv /etc/resolv.conf.dhclient /etc/resolv.conf
+-  elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+-    cat /dev/null > /etc/resolv.conf.dhclient6
+-    chmod 644 /etc/resolv.conf.dhclient6
+-
+-    if [ "x${new_dhcp6_domain_search}" != x ] ; then
+-      echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+-    fi
+-    for nameserver in ${new_dhcp6_name_servers} ; do
+-      echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+-    done
+-
+-    mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
 -  fi
 +      if [ -n "$new_domain_name_servers" ]; then
 +              :> /etc/resolv.conf.dhclient
 +                      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
 +              done
 +              mv /etc/resolv.conf.dhclient /etc/resolv.conf
++      elif [ -n "${new_dhcp6_name_servers}" ] ; then
++              :> /etc/resolv.conf.dhclient6
++              chmod 644 /etc/resolv.conf.dhclient6
++
++              if [ "x${new_dhcp6_domain_search}" != x ] ; then
++                      echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++              fi
++              for nameserver in ${new_dhcp6_name_servers} ; do
++                      echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
++              done
++              mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
 +      fi
  }
  
 -  if [ $exit_status -ne 0 ]; then
 -    exit $exit_status
 -  fi
--fi
--
++      exit_status=0
++      . /etc/dhclient-enter-hooks
++      # allow the local script to abort processing of this state
++      # local script must set exit_status variable to nonzero.
++      if [ $exit_status -ne 0 ]; then
++              exit $exit_status
++      fi
+ fi
 -release=`uname -r`
 -release=`expr $release : '\(.*\)\..*'`
 -relminor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
 -relmajor=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
 -
+ ###
+ ### DHCPv4 Handlers
+ ###
 -if [ x$new_broadcast_address != x ]; then
 -  new_broadcast_arg="broadcast $new_broadcast_address"
 -fi
 -    route add -host $alias_ip_address $interface:0
 -  fi
 -  exit_with_hooks 0
--fi
++if [ -n "$new_broadcast_address" ]; then
++      new_broadcast_arg="broadcast $new_broadcast_address"
+ fi
 -
 -if [ x$reason = xTIMEOUT ]; then
 -  if [ x$alias_ip_address != x ]; then
 -  ifconfig $interface inet $new_ip_address $new_subnet_arg \
 -                                      $new_broadcast_arg
 -  set $new_routers
--  ############## what is -w in ping?
 -  if ping -q -c 1 $1; then
 -    if [ x$new_ip_address != x$alias_ip_address ] && \
 -                      [ x$alias_ip_address != x ]; then
 -  fi
 -  ifconfig $interface inet 0 down
 -  exit_with_hooks 1
--fi
-+      exit_status=0
-+      . /etc/dhclient-enter-hooks
-+      # allow the local script to abort processing of this state
-+      # local script must set exit_status variable to nonzero.
-+      if [ $exit_status -ne 0 ]; then
-+              exit $exit_status
-+      fi
-+fi
-+
-+if [ -n "$new_broadcast_address" ]; then
-+      new_broadcast_arg="broadcast $new_broadcast_address"
-+fi
 +if [ -n "$old_broadcast_address" ]; then
 +      old_broadcast_arg="broadcast $old_broadcast_address"
-+fi
+ fi
+-
+-###
+-### DHCPv6 Handlers
+-###
+-
+-if [ ${reason} = PREINIT6 ] ; then
+-  # Ensure interface is up.
+-  ${ip} link set ${interface} up
+-
+-  # Remove any stale addresses from aborted clients.
+-  ${ip} -f inet6 addr flush dev ${interface} scope global permanent
+-
+-  exit_with_hooks 0
 +if [ -n "$new_subnet_mask" ]; then
 +      new_subnet_arg="$(calc_prefix $new_subnet_mask)"
-+fi
+ fi
 +if [ -n "$old_subnet_mask" ]; then
 +      old_subnet_arg="$(calc_prefix $old_subnet_mask)"
 +fi
 +      fi
 +      exit_with_hooks 1
 +      ;;
++
++  PREINIT6)
++      # Ensure interface is up.
++      /sbin/ip link set ${interface} up
++
++      # Remove any stale addresses from aborted clients.
++      /sbin/ip -f inet6 addr flush dev ${interface} scope global permanent
++
++      exit_with_hooks 0
++      ;;
++  BOUND6)
++      if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then
++              exit_with_hooks 2;
++      fi
+-if [ ${reason} = BOUND6 ] ; then
+-  if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then
+-    exit_with_hooks 2;
+-  fi
+-
+-  ${ip} -f inet6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
++      /sbin/ip -f inet6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
+       dev ${interface} scope global
+-  # Check for nameserver options.
+-  make_resolv_conf
+-
+-  exit_with_hooks 0
+-fi
++      # Check for nameserver options.
++      make_resolv_conf
+-if [ ${reason} = RENEW6 ] || [ ${reason} = REBIND6 ] ; then
+-  # Make sure nothing has moved around on us.
++      exit_with_hooks 0
++      ;;
+-  # Nameservers/domains/etc.
+-  if [ "x${new_dhcp6_name_servers}" != "x${old_dhcp6_name_servers}" ] ||
+-     [ "x${new_dhcp6_domain_search}" != "x${old_dhcp6_domain_search}" ] ; then
+-    make_resolv_conf
+-  fi
+-
+-  exit_with_hooks 0
+-fi
++  RENEW6|REBIND6)
++        # Make sure nothing has moved around on us.
+-if [ ${reason} = DEPREF6 ] ; then
+-  if [ x${new_ip6_prefixlen} = x ] ; then
+-    exit_with_hooks 2;
+-  fi
+-
+-  # There doesn't appear to be a way to update an addr to indicate
+-  # preference.
+-#  ${ip} -f inet6 addr ??? ${new_ip6_address}/${new_ip6_prefixlen} \
+-#       dev ${interface} scope global deprecated?
++      # Nameservers/domains/etc.
++      if [ "x${new_dhcp6_name_servers}" != "x${old_dhcp6_name_servers}" ] ||
++              [ "x${new_dhcp6_domain_search}" != "x${old_dhcp6_domain_search}" ] ; then
++              make_resolv_conf
++      fi
++
++      exit_with_hooks 0
++      ;;
++
++  DEPREF6)
++        if [ x${new_ip6_prefixlen} = x ] ; then
++              exit_with_hooks 2;
++      fi
++
++      # There doesn't appear to be a way to update an addr to indicate
++      # preference.
++      #  /sbin/ip -f inet6 addr ??? ${new_ip6_address}/${new_ip6_prefixlen} \
++      #       dev ${interface} scope global deprecated?
++
++      exit_with_hooks 0
++      ;;
++
++  EXPIRE6|RELEASE6|STOP6)
++        if [ x${old_ip6_address} = x ] || [ x${old_ip6_prefixlen} = x ] ; then
++              exit_with_hooks 2;
++      fi
+-  exit_with_hooks 0
+-fi
+-
+-if [ ${reason} = EXPIRE6 -o ${reason} = RELEASE6 -o ${reason} = STOP6 ] ; then
+-  if [ x${old_ip6_address} = x ] || [ x${old_ip6_prefixlen} = x ] ; then
+-    exit_with_hooks 2;
+-  fi
+-
+-  ${ip} -f inet6 addr del ${old_ip6_address}/${old_ip6_prefixlen} \
++      /sbin/ip -f inet6 addr del ${old_ip6_address}/${old_ip6_prefixlen} \
+       dev ${interface}
+-  exit_with_hooks 0
+-fi
++      exit_with_hooks 0
++      ;;
++      
 +  *)
 +      ;;
 +esac
This page took 0.036722 seconds and 4 git commands to generate.