1. 10 12月, 2013 1 次提交
    • J
      neigh: restore old behaviour of default parms values · 1d4c8c29
      Jiri Pirko 提交于
      Previously inet devices were only constructed when addresses are added.
      Therefore the default neigh parms 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 neigh parms 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.
      
      Introduced by:
      commit 8030f544
      Author: Herbert Xu <herbert@gondor.apana.org.au>
      Date:   Thu Feb 22 01:53:47 2007 +0900
      
          [IPV4] devinet: Register inetdev earlier.
      Signed-off-by: NJiri Pirko <jiri@resnulli.us>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d4c8c29
  2. 27 9月, 2013 1 次提交
    • J
      [networking]device.h: Remove extern from function prototypes · f629d208
      Joe Perches 提交于
      There are a mix of function prototypes with and without extern
      in the kernel sources.  Standardize on not using extern for
      function prototypes.
      
      Function prototypes don't need to be written with extern.
      extern is assumed by the compiler.  Its use is as unnecessary as
      using auto to declare automatic/local variables in a block.
      Signed-off-by: NJoe Perches <joe@perches.com>
      f629d208
  3. 23 8月, 2013 1 次提交
    • S
      ipv4: expose IPV4_DEVCONF · 4a5a8aa6
      stephen hemminger 提交于
      IP sends device configuration (see inet_fill_link_af) as an array
      in the netlink information, but the indices in that array are not
      exposed to userspace through any current santized header file.
      
      It was available back in 2.6.32 (in /usr/include/linux/sysctl.h)
      but was broken by:
        commit 02291680
        Author: Eric W. Biederman <ebiederm@xmission.com>
        Date:   Sun Feb 14 03:25:51 2010 +0000
      
          net ipv4: Decouple ipv4 interface parameters from binary sysctl numbers
      
      Eric was solving the sysctl problem but then the indices were re-exposed
      by a later addition of devconf support for IPV4
      
        commit 9f0f7272
        Author: Thomas Graf <tgraf@infradead.org>
        Date:   Tue Nov 16 04:32:48 2010 +0000
      
          ipv4: AF_INET link address family
      
      Putting them in /usr/include/linux/ip.h seemed the logical match
      for the DEVCONF_ definitions for IPV6 in /usr/include/linux/ip6.h
      Signed-off-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a5a8aa6
  4. 10 8月, 2013 2 次提交
  5. 12 6月, 2013 1 次提交
  6. 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
  7. 05 12月, 2012 1 次提交
  8. 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
  9. 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
  10. 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
  11. 19 2月, 2011 1 次提交
  12. 07 12月, 2010 1 次提交
  13. 18 11月, 2010 1 次提交
  14. 13 11月, 2010 1 次提交
  15. 01 10月, 2010 1 次提交
  16. 16 9月, 2010 1 次提交
  17. 17 2月, 2010 1 次提交
  18. 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
  19. 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
  20. 04 12月, 2009 1 次提交
  21. 05 11月, 2009 1 次提交
  22. 28 7月, 2009 1 次提交
  23. 01 2月, 2009 1 次提交
  24. 08 10月, 2008 1 次提交
  25. 04 6月, 2008 1 次提交
  26. 26 3月, 2008 1 次提交
  27. 29 2月, 2008 1 次提交
  28. 01 2月, 2008 1 次提交
  29. 29 1月, 2008 6 次提交
  30. 23 6月, 2007 1 次提交
  31. 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
  32. 03 12月, 2006 1 次提交