1. 26 4月, 2010 1 次提交
    • P
      net: rtnetlink: decouple rtnetlink address families from real address families · 25239cee
      Patrick McHardy 提交于
      Decouple rtnetlink address families from real address families in socket.h to
      be able to add rtnetlink interfaces to code that is not a real address family
      without increasing AF_MAX/NPROTO.
      
      This will be used to add support for multicast route dumping from all tables
      as the proc interface can't be extended to support anything but the main table
      without breaking compatibility.
      
      This partialy undoes the patch to introduce independant families for routing
      rules and converts ipmr routing rules to a new rtnetlink family. Similar to
      that patch, values up to 127 are reserved for real address families, values
      above that may be used arbitrarily.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      25239cee
  2. 14 4月, 2010 2 次提交
    • P
      ipv4: ipmr: support multiple tables · f0ad0860
      Patrick McHardy 提交于
      This patch adds support for multiple independant multicast routing instances,
      named "tables".
      
      Userspace multicast routing daemons can bind to a specific table instance by
      issuing a setsockopt call using a new option MRT_TABLE. The table number is
      stored in the raw socket data and affects all following ipmr setsockopt(),
      getsockopt() and ioctl() calls. By default, a single table (RT_TABLE_DEFAULT)
      is created with a default routing rule pointing to it. Newly created pimreg
      devices have the table number appended ("pimregX"), with the exception of
      devices created in the default table, which are named just "pimreg" for
      compatibility reasons.
      
      Packets are directed to a specific table instance using routing rules,
      similar to how regular routing rules work. Currently iif, oif and mark
      are supported as keys, source and destination addresses could be supported
      additionally.
      
      Example usage:
      
      - bind pimd/xorp/... to a specific table:
      
      uint32_t table = 123;
      setsockopt(fd, IPPROTO_IP, MRT_TABLE, &table, sizeof(table));
      
      - create routing rules directing packets to the new table:
      
      # ip mrule add iif eth0 lookup 123
      # ip mrule add oif eth0 lookup 123
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0ad0860
    • P
      net: fib_rules: decouple address families from real address families · 0f87b1dd
      Patrick McHardy 提交于
      Decouple the address family values used for fib_rules from the real
      address families in socket.h. This allows to use fib_rules for
      code that is not a real address family without increasing AF_MAX/NPROTO.
      
      Values up to 127 are reserved for real address families and map directly
      to the corresponding AF value, values starting from 128 are for other
      uses. rtnetlink is changed to invoke the AF_UNSPEC dumpit/doit handlers
      for these families.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f87b1dd
  3. 04 12月, 2009 2 次提交
  4. 05 11月, 2009 1 次提交
  5. 26 4月, 2007 4 次提交
    • Y
      [IPV6] FIB6RULE: Find source address during looking up route. · 29f6af77
      YOSHIFUJI Hideaki 提交于
      When looking up route for destination with rules with
      source address restrictions, we may need to find a source
      address for the traffic if not given.
      
      Based on patch from Noriaki TAKAMIYA <takamiya@po.ntts.co.jp>.
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29f6af77
    • T
      [NET] fib_rules: Add no-operation action · fa0b2d1d
      Thomas Graf 提交于
      The use of nop rules simplifies the usage of goto rules
      and adds more flexibility as they allow targets to remain
      while the actual content of the branches can change easly.
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fa0b2d1d
    • T
      [NET] fib_rules: Mark rules detached from the device · 2b443683
      Thomas Graf 提交于
      Rules which match against device names in their selector can
      remain while the device itself disappears, in fact the device
      doesn't have to present when the rule is added in the first
      place. The device name is resolved by trying when the rule is
      added and later by listening to NETDEV_REGISTER/UNREGISTER
      notifications.
      
      This patch adds the flag FIB_RULE_DEV_DETACHED which is set
      towards userspace when a rule contains a device match which
      is unresolved at the moment. This eases spotting the reason
      why certain rules seem not to function properly.
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b443683
    • T
      [NET] fib_rules: goto rule action · 0947c9fe
      Thomas Graf 提交于
      This patch adds a new rule action FR_ACT_GOTO which allows
      to skip a set of rules by jumping to another rule. The rule
      to jump to is specified via the FRA_GOTO attribute which
      carries a rule preference.
      
      Referring to a rule which doesn't exists is explicitely allowed.
      Such goto rules are marked with the flag FIB_RULE_UNRESOLVED
      and will act like a rule with a non-matching selector. The rule
      will become functional as soon as its target is present.
      
      The goto action enables performance optimizations by reducing
      the average number of rules that have to be passed per lookup.
      
      Example:
      0:      from all lookup local
      40:     not from all to 192.168.23.128 goto 32766
      41:     from all fwmark 0xa blackhole
      42:     from all fwmark 0xff blackhole
      32766:  from all lookup main
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0947c9fe
  6. 03 12月, 2006 2 次提交
  7. 23 9月, 2006 4 次提交