1. 29 4月, 2011 3 次提交
    • D
      ipv4: Fetch route saddr from flow key in l2tp_ip_connect(). · 44901666
      David S. Miller 提交于
      Now that output route lookups update the flow with
      source address selection, we can fetch it from
      fl4->saddr instead of rt->rt_src
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      44901666
    • D
      l2tp: Fix inet_opt conversion. · 778865a5
      David S. Miller 提交于
      We don't actually hold the socket lock at this point, so the
      rcu_dereference_protected() isn't' correct.  Thanks to Eric
      Dumazet for pointing this out.
      
      Thankfully, we're only interested in fetching the faddr value
      if srr is enabled, so we can simply make this an RCU sequence
      and use plain rcu_dereference().
      Reported-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      778865a5
    • E
      inet: add RCU protection to inet->opt · f6d8bd05
      Eric Dumazet 提交于
      We lack proper synchronization to manipulate inet->opt ip_options
      
      Problem is ip_make_skb() calls ip_setup_cork() and
      ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
      without any protection against another thread manipulating inet->opt.
      
      Another thread can change inet->opt pointer and free old one under us.
      
      Use RCU to protect inet->opt (changed to inet->inet_opt).
      
      Instead of handling atomic refcounts, just copy ip_options when
      necessary, to avoid cache line dirtying.
      
      We cant insert an rcu_head in struct ip_options since its included in
      skb->cb[], so this patch is large because I had to introduce a new
      ip_options_rcu structure.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f6d8bd05
  2. 28 4月, 2011 1 次提交
    • D
      ipv4: Sanitize and simplify ip_route_{connect,newports}() · 2d7192d6
      David S. Miller 提交于
      These functions are used together as a unit for route resolution
      during connect().  They address the chicken-and-egg problem that
      exists when ports need to be allocated during connect() processing,
      yet such port allocations require addressing information from the
      routing code.
      
      It's currently more heavy handed than it needs to be, and in
      particular we allocate and initialize a flow object twice.
      
      Let the callers provide the on-stack flow object.  That way we only
      need to initialize it once in the ip_route_connect() call.
      
      Later, if ip_route_newports() needs to do anything, it re-uses that
      flow object as-is except for the ports which it updates before the
      route re-lookup.
      
      Also, describe why this set of facilities are needed and how it works
      in a big comment.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Reviewed-by: NEric Dumazet <eric.dumazet@gmail.com>
      2d7192d6
  3. 13 3月, 2011 1 次提交
  4. 03 3月, 2011 1 次提交
  5. 02 3月, 2011 3 次提交
  6. 09 12月, 2010 1 次提交
  7. 18 11月, 2010 1 次提交
  8. 25 10月, 2010 1 次提交
  9. 21 10月, 2010 1 次提交
  10. 11 6月, 2010 1 次提交
  11. 16 4月, 2010 1 次提交
  12. 04 4月, 2010 1 次提交
    • J
      l2tp: Add L2TPv3 IP encapsulation (no UDP) support · 0d76751f
      James Chapman 提交于
      This patch adds a new L2TPIP socket family and modifies the core to
      handle the case where there is no UDP header in the L2TP
      packet. L2TP/IP uses IP protocol 115. Since L2TP/UDP and L2TP/IP
      packets differ in layout, the datapath packet handling code needs
      changes too. Userspace uses an L2TPIP socket instead of a UDP socket
      when IP encapsulation is required.
      
      We can't use raw sockets for this because the semantics of raw sockets
      don't lend themselves to the socket-per-tunnel model - we need to
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0d76751f