1. 30 1月, 2013 1 次提交
    • J
      ipv4: introduce address lifetime · 5c766d64
      Jiri Pirko 提交于
      There are some usecase when lifetime of ipv4 addresses might be helpful.
      For example:
      1) initramfs networkmanager uses a DHCP daemon to learn network
      configuration parameters
      2) initramfs networkmanager addresses, routes and DNS configuration
      3) initramfs networkmanager is requested to stop
      4) initramfs networkmanager stops all daemons including dhclient
      5) there are addresses and routes configured but no daemon running. If
      the system doesn't start networkmanager for some reason, addresses and
      routes will be used forever, which violates RFC 2131.
      
      This patch is essentially a backport of ivp6 address lifetime mechanism
      for ipv4 addresses.
      
      Current "ip" tool supports this without any patch (since it does not
      distinguish between ipv4 and ipv6 addresses in this perspective.
      
      Also, this should be back-compatible with all current netlink users.
      Reported-by: NPavel Šimerda <psimerda@redhat.com>
      Signed-off-by: NJiri Pirko <jiri@resnulli.us>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c766d64
  2. 05 12月, 2012 1 次提交
  3. 04 8月, 2012 1 次提交
    • E
      ipv4: Introduce IN_DEV_NET_ROUTE_LOCALNET · 9eb43e76
      Eric Dumazet 提交于
      performance profiles show a high cost in the IN_DEV_ROUTE_LOCALNET()
      call done in ip_route_input_slow(), because of multiple dereferences,
      even if cache lines are clean and available in cpu caches.
      
      Since we already have the 'net' pointer, introduce
      IN_DEV_NET_ROUTE_LOCALNET() macro avoiding two dereferences
      (dev_net(in_dev->dev))
      
      Also change the tests to use IN_DEV_NET_ROUTE_LOCALNET() only if saddr
      or/and daddr are loopback addresse.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9eb43e76
  4. 13 6月, 2012 1 次提交
    • T
      ipv4: Add interface option to enable routing of 127.0.0.0/8 · d0daebc3
      Thomas Graf 提交于
      Routing of 127/8 is tradtionally forbidden, we consider
      packets from that address block martian when routing and do
      not process corresponding ARP requests.
      
      This is a sane default but renders a huge address space
      practically unuseable.
      
      The RFC states that no address within the 127/8 block should
      ever appear on any network anywhere but it does not forbid
      the use of such addresses outside of the loopback device in
      particular. For example to address a pool of virtual guests
      behind a load balancer.
      
      This patch adds a new interface option 'route_localnet'
      enabling routing of the 127/8 address block and processing
      of ARP requests on a specific interface.
      
      Note that for the feature to work, the default local route
      covering 127/8 dev lo needs to be removed.
      
      Example:
        $ sysctl -w net.ipv4.conf.eth0.route_localnet=1
        $ ip route del 127.0.0.0/8 dev lo table local
        $ ip addr add 127.1.0.1/16 dev eth0
        $ ip route flush cache
      
      V2: Fix invalid check to auto flush cache (thanks davem)
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0daebc3
  5. 17 3月, 2012 1 次提交
    • N
      arp: allow arp processing to honor per interface arp_accept sysctl · 124d37e9
      Neil Horman 提交于
      I found recently that the arp_process function which handles all of our received
      arp frames, is using IPV4_DEVCONF_ALL macro to check the state of the arp_process
      flag.  This seems wrong, as it implies that either none or all of the network
      interfaces accept gratuitous arps.  This patch corrects that, allowing
      per-interface arp_accept configuration to deviate from the all setting.  Note
      this also brings us into line with the way the arp_filter setting is handled
      during arp_process execution.
      
      Tested this myself on my home network, and confirmed it works as expected.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      124d37e9
  6. 19 2月, 2011 1 次提交
  7. 07 12月, 2010 1 次提交
  8. 18 11月, 2010 1 次提交
  9. 13 11月, 2010 1 次提交
  10. 01 10月, 2010 1 次提交
  11. 16 9月, 2010 1 次提交
  12. 17 2月, 2010 1 次提交
  13. 07 1月, 2010 1 次提交
    • J
      net: RFC3069, private VLAN proxy arp support · 65324144
      Jesper Dangaard Brouer 提交于
      This is to be used together with switch technologies, like RFC3069,
      that where the individual ports are not allowed to communicate with
      each other, but they are allowed to talk to the upstream router.  As
      described in RFC 3069, it is possible to allow these hosts to
      communicate through the upstream router by proxy_arp'ing.
      
      This patch basically allow proxy arp replies back to the same
      interface (from which the ARP request/solicitation was received).
      
      Tunable per device via proc "proxy_arp_pvlan":
        /proc/sys/net/ipv4/conf/*/proxy_arp_pvlan
      
      This switch technology is known by different vendor names:
       - In RFC 3069 it is called VLAN Aggregation.
       - Cisco and Allied Telesyn call it Private VLAN.
       - Hewlett-Packard call it Source-Port filtering or port-isolation.
       - Ericsson call it MAC-Forced Forwarding (RFC Draft).
      Signed-off-by: NJesper Dangaard Brouer <hawk@comx.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65324144
  14. 26 12月, 2009 1 次提交
    • J
      net: restore ip source validation · 28f6aeea
      Jamal Hadi Salim 提交于
      when using policy routing and the skb mark:
      there are cases where a back path validation requires us
      to use a different routing table for src ip validation than
      the one used for mapping ingress dst ip.
      One such a case is transparent proxying where we pretend to be
      the destination system and therefore the local table
      is used for incoming packets but possibly a main table would
      be used on outbound.
      Make the default behavior to allow the above and if users
      need to turn on the symmetry via sysctl src_valid_mark
      Signed-off-by: NJamal Hadi Salim <hadi@cyberus.ca>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28f6aeea
  15. 04 12月, 2009 1 次提交
  16. 05 11月, 2009 1 次提交
  17. 28 7月, 2009 1 次提交
  18. 01 2月, 2009 1 次提交
  19. 08 10月, 2008 1 次提交
  20. 04 6月, 2008 1 次提交
  21. 26 3月, 2008 1 次提交
  22. 29 2月, 2008 1 次提交
  23. 01 2月, 2008 1 次提交
  24. 29 1月, 2008 6 次提交
  25. 23 6月, 2007 1 次提交
  26. 08 6月, 2007 3 次提交
    • H
      [IPV4]: Restore old behaviour of default config values · 71e27da9
      Herbert Xu 提交于
      Previously inet devices were only constructed when addresses are added
      (or rarely in ipmr).  Therefore the default config values they get are
      the ones at the time of these operations.
      
      Now that we're creating inet devices earlier, this changes the
      behaviour of default config values in an incompatible way (see bug
      #8519).
      
      This patch creates a compromise by setting the default values at the
      same point as before but only for those that have not been explicitly
      set by the user since the inet device's creation.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71e27da9
    • H
      [IPV4]: Add default config support after inetdev_init · 31be3085
      Herbert Xu 提交于
      Previously once inetdev_init has been called on a device any changes
      made to ipv4_devconf_dflt would have no effect on that device's
      configuration.
      
      This creates a problem since we have moved the point where
      inetdev_init is called from when an address is added to where the
      device is registered.
      
      This patch is the first half of a set that tries to mimic the old
      behaviour while still calling inetdev_init.
      
      It propagates any changes to ipv4_devconf_dflt to those devices that
      have not had the corresponding attribute set.
      
      The next patch will forcibly set all values at the point where
      inetdev_init was previously called.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31be3085
    • H
      [IPV4]: Convert IPv4 devconf to an array · 42f811b8
      Herbert Xu 提交于
      This patch converts the ipv4_devconf config members (everything except
      sysctl) to an array.  This allows easier manipulation which will be
      needed later on to provide better management of default config values.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      42f811b8
  27. 03 12月, 2006 1 次提交
  28. 29 9月, 2006 4 次提交
  29. 21 3月, 2006 1 次提交
  30. 04 10月, 2005 1 次提交
    • H
      [IPV4]: Replace __in_dev_get with __in_dev_get_rcu/rtnl · e5ed6399
      Herbert Xu 提交于
      The following patch renames __in_dev_get() to __in_dev_get_rtnl() and
      introduces __in_dev_get_rcu() to cover the second case.
      
      1) RCU with refcnt should use in_dev_get().
      2) RCU without refcnt should use __in_dev_get_rcu().
      3) All others must hold RTNL and use __in_dev_get_rtnl().
      
      There is one exception in net/ipv4/route.c which is in fact a pre-existing
      race condition.  I've marked it as such so that we remember to fix it.
      
      This patch is based on suggestions and prior work by Suzanne Wood and
      Paul McKenney.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5ed6399