1. 06 11月, 2009 2 次提交
  2. 15 9月, 2009 1 次提交
  3. 23 6月, 2009 1 次提交
  4. 16 2月, 2009 1 次提交
  5. 23 1月, 2009 1 次提交
  6. 30 10月, 2008 1 次提交
  7. 29 10月, 2008 1 次提交
  8. 09 10月, 2008 1 次提交
  9. 01 10月, 2008 1 次提交
  10. 15 8月, 2008 1 次提交
  11. 04 8月, 2008 1 次提交
    • H
      sctp: Drop ipfargok in sctp_xmit function · f880374c
      Herbert Xu 提交于
      The ipfragok flag controls whether the packet may be fragmented
      either on the local host on beyond.  The latter is only valid on
      IPv4.
      
      In fact, we never want to do the latter even on IPv4 when PMTU is
      enabled.  This is because even though we can't fragment packets
      within SCTP due to the prtocol's inherent faults, we can still
      fragment it at IP layer.  By setting the DF bit we will improve
      the PMTU process.
      
      RFC 2960 only says that we SHOULD clear the DF bit in this case,
      so we're compliant even if we set the DF bit.  In fact RFC 4960
      no longer has this statement.
      
      Once we make this change, we only need to control the local
      fragmentation.  There is already a bit in the skb which controls
      that, local_df.  So this patch sets that instead of using the
      ipfragok argument.
      
      The only complication is that there isn't a struct sock object
      per transport, so for IPv4 we have to resort to changing the
      pmtudisc field for every packet.  This should be safe though
      as the protocol is single-threaded.
      
      Note that after this patch we can remove ipfragok from the rest
      of the stack too.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f880374c
  12. 19 7月, 2008 1 次提交
  13. 05 6月, 2008 2 次提交
  14. 13 4月, 2008 1 次提交
  15. 26 3月, 2008 1 次提交
  16. 25 3月, 2008 1 次提交
  17. 21 3月, 2008 1 次提交
    • V
      [SCTP]: Fix a race between module load and protosw access · 270637ab
      Vlad Yasevich 提交于
      There is a race is SCTP between the loading of the module
      and the access by the socket layer to the protocol functions.
      In particular, a list of addresss that SCTP maintains is
      not initialized prior to the registration with the protosw.
      Thus it is possible for a user application to gain access
      to SCTP functions before everything has been initialized.
      The problem shows up as odd crashes during connection
      initializtion when we try to access the SCTP address list.
      
      The solution is to refactor how we do registration and
      initialize the lists prior to registering with the protosw.
      Care must be taken since the address list initialization
      depends on some other pieces of SCTP initialization.  Also
      the clean-up in case of failure now also needs to be refactored.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Acked-by: NSridhar Samudrala <sri@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      270637ab
  18. 12 3月, 2008 1 次提交
  19. 06 3月, 2008 2 次提交
  20. 04 3月, 2008 1 次提交
  21. 29 2月, 2008 1 次提交
  22. 05 2月, 2008 1 次提交
  23. 29 1月, 2008 2 次提交
  24. 01 11月, 2007 1 次提交
  25. 16 10月, 2007 1 次提交
  26. 11 10月, 2007 3 次提交
    • 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 socket creation namespace safe. · 1b8d7ae4
      Eric W. Biederman 提交于
      This patch passes in the namespace a new socket should be created in
      and has the socket code do the appropriate reference counting.  By
      virtue of this all socket create methods are touched.  In addition
      the socket create methods are modified so that they will fail if
      you attempt to create a socket in a non-default network namespace.
      
      Failing if we attempt to create a socket outside of the default
      network namespace ensures that as we incrementally make the network stack
      network namespace aware we will not export functionality that someone
      has not audited and made certain is network namespace safe.
      Allowing us to partially enable network namespaces before all of the
      exotic protocols are supported.
      
      Any protocol layers I have missed will fail to compile because I now
      pass an extra parameter into the socket creation code.
      
      [ Integrated AF_IUCV build fixes from Andrew Morton... -DaveM ]
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b8d7ae4
    • B
      [IPV6]: Add v4mapped address inline · e773e4fa
      Brian Haley 提交于
      Add v4mapped address inline to avoid calls to ipv6_addr_type().
      Signed-off-by: NBrian Haley <brian.haley@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e773e4fa
  27. 17 9月, 2007 2 次提交
  28. 01 8月, 2007 1 次提交
  29. 06 7月, 2007 1 次提交
  30. 05 5月, 2007 1 次提交
  31. 26 4月, 2007 3 次提交
    • S
      [NET]: cleanup extra semicolons · 3ff50b79
      Stephen Hemminger 提交于
      Spring cleaning time...
      
      There seems to be a lot of places in the network code that have
      extra bogus semicolons after conditionals.  Most commonly is a
      bogus semicolon after: switch() { }
      Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3ff50b79
    • A
      [SK_BUFF]: Use offsets for skb->{mac,network,transport}_header on 64bit architectures · 2e07fa9c
      Arnaldo Carvalho de Melo 提交于
      With this we save 8 bytes per network packet, leaving a 4 bytes hole to be used
      in further shrinking work, likely with the offsetization of other pointers,
      such as ->{data,tail,end}, at the cost of adds, that were minimized by the
      usual practice of setting skb->{mac,nh,n}.raw to a local variable that is then
      accessed multiple times in each function, it also is not more expensive than
      before with regards to most of the handling of such headers, like setting one
      of these headers to another (transport to network, etc), or subtracting, adding
      to/from it, comparing them, etc.
      
      Now we have this layout for sk_buff on a x86_64 machine:
      
      [acme@mica net-2.6.22]$ pahole vmlinux sk_buff
      struct sk_buff {
      	struct sk_buff *       next;             /*   0   8 */
      	struct sk_buff *       prev;             /*   8   8 */
      	struct rb_node         rb;               /*  16  24 */
      	struct sock *          sk;               /*  40   8 */
      	ktime_t                tstamp;           /*  48   8 */
      	struct net_device *    dev;              /*  56   8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	struct net_device *    input_dev;        /*  64   8 */
      	sk_buff_data_t         transport_header; /*  72   4 */
      	sk_buff_data_t         network_header;   /*  76   4 */
      	sk_buff_data_t         mac_header;       /*  80   4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct dst_entry *     dst;              /*  88   8 */
      	struct sec_path *      sp;               /*  96   8 */
      	char                   cb[48];           /* 104  48 */
      	/* cacheline 2 boundary (128 bytes) was 24 bytes ago*/
      	unsigned int           len;              /* 152   4 */
      	unsigned int           data_len;         /* 156   4 */
      	unsigned int           mac_len;          /* 160   4 */
      	union {
      		__wsum         csum;             /*       4 */
      		__u32          csum_offset;      /*       4 */
      	};                                       /* 164   4 */
      	__u32                  priority;         /* 168   4 */
      	__u8                   local_df:1;       /* 172   1 */
      	__u8                   cloned:1;         /* 172   1 */
      	__u8                   ip_summed:2;      /* 172   1 */
      	__u8                   nohdr:1;          /* 172   1 */
      	__u8                   nfctinfo:3;       /* 172   1 */
      	__u8                   pkt_type:3;       /* 173   1 */
      	__u8                   fclone:2;         /* 173   1 */
      	__u8                   ipvs_property:1;  /* 173   1 */
      
      	/* XXX 2 bits hole, try to pack */
      
      	__be16                 protocol;         /* 174   2 */
      	void    (*destructor)(struct sk_buff *); /* 176   8 */
      	struct nf_conntrack *  nfct;             /* 184   8 */
      	/* --- cacheline 3 boundary (192 bytes) --- */
      	struct sk_buff *       nfct_reasm;       /* 192   8 */
      	struct nf_bridge_info *nf_bridge;        /* 200   8 */
      	__u16                  tc_index;         /* 208   2 */
      	__u16                  tc_verd;          /* 210   2 */
      	dma_cookie_t           dma_cookie;       /* 212   4 */
      	__u32                  secmark;          /* 216   4 */
      	__u32                  mark;             /* 220   4 */
      	unsigned int           truesize;         /* 224   4 */
      	atomic_t               users;            /* 228   4 */
      	unsigned char *        head;             /* 232   8 */
      	unsigned char *        data;             /* 240   8 */
      	unsigned char *        tail;             /* 248   8 */
      	/* --- cacheline 4 boundary (256 bytes) --- */
      	unsigned char *        end;              /* 256   8 */
      }; /* size: 264, cachelines: 5 */
         /* sum members: 260, holes: 1, sum holes: 4 */
         /* bit holes: 1, sum bit holes: 2 bits */
         /* last cacheline: 8 bytes */
      
      On 32 bits nothing changes, and pointers continue to be used with the compiler
      turning all this abstraction layer into dust. But there are some sk_buff
      validation tricks that are now possible, humm... :-)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e07fa9c
    • A
      [SK_BUFF]: unions of just one member don't get anything done, kill them · b0e380b1
      Arnaldo Carvalho de Melo 提交于
      Renaming skb->h to skb->transport_header, skb->nh to skb->network_header and
      skb->mac to skb->mac_header, to match the names of the associated helpers
      (skb[_[re]set]_{transport,network,mac}_header).
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0e380b1