1. 11 10月, 2007 6 次提交
    • P
      [NET]: Make core networking code use seq_open_private · cf7732e4
      Pavel Emelyanov 提交于
      This concerns the ipv4 and ipv6 code mostly, but also the netlink
      and unix sockets.
      
      The netlink code is an example of how to use the __seq_open_private()
      call - it saves the net namespace on this private.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cf7732e4
    • S
      [NET]: sparse warning fixes · cfcabdcc
      Stephen Hemminger 提交于
      Fix a bunch of sparse warnings. Mostly about 0 used as
      NULL pointer, and shadowed variable declarations.
      One notable case was that hash size should have been unsigned.
      Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cfcabdcc
    • S
      [NET]: Wrap netdevice hardware header creation. · 0c4e8581
      Stephen Hemminger 提交于
      Add inline for common usage of hardware header creation, and
      fix bug in IPV6 mcast where the assumption about negative return is
      an errno. Negative return from hard_header means not enough space
      was available,(ie -N bytes).
      Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c4e8581
    • D
      [IPV6]: Add ICMPMsgStats MIB (RFC 4293) [rev 2] · 14878f75
      David L Stevens 提交于
      Background: RFC 4293 deprecates existing individual, named ICMP
      type counters to be replaced with the ICMPMsgStatsTable. This table
      includes entries for both IPv4 and IPv6, and requires counting of all
      ICMP types, whether or not the machine implements the type.
      
      These patches "remove" (but not really) the existing counters, and
      replace them with the ICMPMsgStats tables for v4 and v6.
      It includes the named counters in the /proc places they were, but gets the
      values for them from the new tables. It also counts packets generated
      from raw socket output (e.g., OutEchoes, MLD queries, RA's from
      radvd, etc).
      
      Changes:
      1) create icmpmsg_statistics mib
      2) create icmpv6msg_statistics mib
      3) modify existing counters to use these
      4) modify /proc/net/snmp to add "IcmpMsg" with all ICMP types
              listed by number for easy SNMP parsing
      5) modify /proc/net/snmp printing for "Icmp" to get the named data
              from new counters.
      [new to 2nd revision]
      6) support per-interface ICMP stats
      7) use common macro for per-device stat macros
      Signed-off-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      14878f75
    • E
      [NET]: Make the device list and device lookups per namespace. · 881d966b
      Eric W. Biederman 提交于
      This patch makes most of the generic device layer network
      namespace safe.  This patch makes dev_base_head a
      network namespace variable, and then it picks up
      a few associated variables.  The functions:
      dev_getbyhwaddr
      dev_getfirsthwbytype
      dev_get_by_flags
      dev_get_by_name
      __dev_get_by_name
      dev_get_by_index
      __dev_get_by_index
      dev_ioctl
      dev_ethtool
      dev_load
      wireless_process_ioctl
      
      were modified to take a network namespace argument, and
      deal with it.
      
      vlan_ioctl_set and brioctl_set were modified so their
      hooks will receive a network namespace argument.
      
      So basically anthing in the core of the network stack that was
      affected to by the change of dev_base was modified to handle
      multiple network namespaces.  The rest of the network stack was
      simply modified to explicitly use &init_net the initial network
      namespace.  This can be fixed when those components of the network
      stack are modified to handle multiple network namespaces.
      
      For now the ifindex generator is left global.
      
      Fundametally ifindex numbers are per namespace, or else
      we will have corner case problems with migration when
      we get that far.
      
      At the same time there are assumptions in the network stack
      that the ifindex of a network device won't change.  Making
      the ifindex number global seems a good compromise until
      the network stack can cope with ifindex changes when
      you change namespaces, and the like.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      881d966b
    • E
      [NET]: Make /proc/net per network namespace · 457c4cbc
      Eric W. Biederman 提交于
      This patch makes /proc/net per network namespace.  It modifies the global
      variables proc_net and proc_net_stat to be per network namespace.
      The proc_net file helpers are modified to take a network namespace argument,
      and all of their callers are fixed to pass &init_net for that argument.
      This ensures that all of the /proc/net files are only visible and
      usable in the initial network namespace until the code behind them
      has been updated to be handle multiple network namespaces.
      
      Making /proc/net per namespace is necessary as at least some files
      in /proc/net depend upon the set of network devices which is per
      network namespace, and even more files in /proc/net have contents
      that are relevant to a single network namespace.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      457c4cbc
  2. 11 7月, 2007 1 次提交
  3. 04 5月, 2007 1 次提交
  4. 26 4月, 2007 7 次提交
  5. 13 2月, 2007 1 次提交
  6. 11 2月, 2007 1 次提交
  7. 09 2月, 2007 1 次提交
  8. 24 1月, 2007 1 次提交
  9. 03 12月, 2006 3 次提交
  10. 23 9月, 2006 1 次提交
  11. 18 8月, 2006 1 次提交
  12. 01 7月, 2006 1 次提交
  13. 21 3月, 2006 1 次提交
  14. 08 2月, 2006 1 次提交
  15. 25 1月, 2006 1 次提交
    • D
      [IPV6] MLDv2: fix change records when transitioning to/from inactive · 7add2a43
      David L Stevens 提交于
      The following patch fixes these problems in MLDv2:
      
      1) Add/remove "delete" records for sending change reports when
              addition of a filter results in that filter transitioning to/from
              inactive. [same as recent IPv4 IGMPv3 fix]
      2) Remove 2 redundant "group_type" checks (can't be IPV6_ADDR_ANY
              within that loop, so checks are always true)
      3) change an is_in() "return 0" to "return type == MLD2_MODE_IS_INCLUDE".
              It should always be "0" to get here, but it improves code locality 
              to not assume it, and if some race allowed otherwise, doing
              the check would return the correct result.
      Signed-off-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7add2a43
  16. 17 1月, 2006 1 次提交
  17. 14 1月, 2006 1 次提交
    • J
      [NET]: Use NIP6_FMT in kernel.h · 46b86a2d
      Joe Perches 提交于
      There are errors and inconsistency in the display of NIP6 strings.
      	ie: net/ipv6/ip6_flowlabel.c
      
      There are errors and inconsistency in the display of NIPQUAD strings too.
      	ie: net/netfilter/nf_conntrack_ftp.c
      
      This patch:
      	adds NIP6_FMT to kernel.h
      	changes all code to use NIP6_FMT
      	fixes net/ipv6/ip6_flowlabel.c
      	adds NIPQUAD_FMT to kernel.h
      	fixes net/netfilter/nf_conntrack_ftp.c
      	changes a few uses of "%u.%u.%u.%u" to NIPQUAD_FMT for symmetry to NIP6_FMT
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46b86a2d
  18. 12 1月, 2006 1 次提交
  19. 05 1月, 2006 1 次提交
  20. 28 12月, 2005 1 次提交
    • D
      [IPV6] mcast: Fix multiple issues in MLDv2 reports. · 5ab4a6c8
      David L Stevens 提交于
      The below "jumbo" patch fixes the following problems in MLDv2.
      
      1) Add necessary "ntohs" to recent "pskb_may_pull" check [breaks
              all nonzero source queries on little-endian (!)]
      
      2) Add locking to source filter list [resend of prior patch]
      
      3) fix "mld_marksources()" to
              a) send nothing when all queried sources are excluded
              b) send full exclude report when source queried sources are
                      not excluded
              c) don't schedule a timer when there's nothing to report
      
      NOTE: RFC 3810 specifies the source list should be saved and each
        source reported individually as an IS_IN. This is an obvious DOS
        path, requiring the host to store and then multicast as many sources
        as are queried (e.g., millions...). This alternative sends a full, 
        relevant report that's limited to number of sources present on the
        machine.
      
      4) fix "add_grec()" to send empty-source records when it should
              The original check doesn't account for a non-empty source
              list with all sources inactive; the new code keeps that
              short-circuit case, and also generates the group header
              with an empty list if needed.
      
      5) fix mca_crcount decrement to be after add_grec(), which needs
              its original value
      
      These issues (other than item #1 ;-) ) were all found by Yan Zheng,
      much thanks!
      Signed-off-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ab4a6c8
  21. 27 12月, 2005 1 次提交
  22. 03 12月, 2005 1 次提交
  23. 03 11月, 2005 1 次提交
    • Y
      [MCAST]: ip[6]_mc_add_src should be called when number of sources is zero · 8713dbf0
      Yan Zheng 提交于
      And filter mode is exclude.
      
      Further explanation by David Stevens:
      
      Multicast source filters aren't widely used yet, and that's really the only
      feature that's affected if an application actually exercises this bug, as far
      as I can tell. An ordinary filter-less multicast join should still work, and
      only forwarded multicast traffic making use of filters and doing empty-source
      filters with the MSFILTER ioctl would be at risk of not getting multicast
      traffic forwarded to them because the reports generated would not be based on
      the correct counts.
      
      Signed-off-by: Yan Zheng <yanzheng@21cn.com
      Acked-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@mandriva.com>
      8713dbf0
  24. 01 11月, 2005 1 次提交
  25. 29 10月, 2005 1 次提交
    • Y
      [MCAST] IPv6: Fix algorithm to compute Querier's Query Interval · f12baeab
      Yan Zheng 提交于
      5.1.3.  Maximum Response Code
      
         The Maximum Response Code field specifies the maximum time allowed
         before sending a responding Report.  The actual time allowed, called
         the Maximum Response Delay, is represented in units of milliseconds,
         and is derived from the Maximum Response Code as follows:
      
         If Maximum Response Code < 32768,
            Maximum Response Delay = Maximum Response Code
      
         If Maximum Response Code >=32768, Maximum Response Code represents a
         floating-point value as follows:
      
             0 1 2 3 4 5 6 7 8 9 A B C D E F
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |1| exp |          mant         |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      
         Maximum Response Delay = (mant | 0x1000) << (exp+3)
      
      
      5.1.9.  QQIC (Querier's Query Interval Code)
      
         The Querier's Query Interval Code field specifies the [Query
         Interval] used by the Querier.  The actual interval, called the
         Querier's Query Interval (QQI), is represented in units of seconds,
         and is derived from the Querier's Query Interval Code as follows:
      
         If QQIC < 128, QQI = QQIC
      
         If QQIC >= 128, QQIC represents a floating-point value as follows:
      
             0 1 2 3 4 5 6 7
            +-+-+-+-+-+-+-+-+
            |1| exp | mant  |
            +-+-+-+-+-+-+-+-+
      
         QQI = (mant | 0x10) << (exp + 3)
      
                                                      -- rfc3810
      
      #define MLDV2_QQIC(value) MLDV2_EXP(0x80, 4, 3, value)
      #define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value)
      
      Above macro are defined in mcast.c. but 1 << 4 == 0x10 and 1 << 12 == 0x1000.
      So the result computed by original Macro is larger.
      Signed-off-by: NYan Zheng <yanzheng@21cn.com>
      Acked-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@mandriva.com>
      f12baeab
  26. 06 10月, 2005 1 次提交
  27. 15 9月, 2005 1 次提交