1. 19 Mar, 2013 1 commit
  2. 06 Feb, 2013 1 commit
    • Daniel Borkmann's avatar
      ipvs: sctp: fix checksumming on snat and dnat handlers · 4b47bc9a
      Daniel Borkmann authored
      In our test lab, we have a simple SCTP client connecting to a SCTP
      server via an IPVS load balancer. On some machines, load balancing
      works, but on others the initial handshake just fails, thus no
      SCTP connection whatsoever can be established!
      
      We observed that the SCTP INIT-ACK handshake reply from the IPVS
      machine to the client had a correct IP checksum, but corrupt SCTP
      checksum when forwarded, thus on the client-side the packet was
      dropped and an intial handshake retriggered until all attempts
      run into the void.
      
      To fix this issue, this patch i) adds a missing CHECKSUM_UNNECESSARY
      after the full checksum (re-)calculation (as done in IPVS TCP and UDP
      code as well), ii) calculates the checksum in little-endian format
      (as fixed with the SCTP code in commit 4458f04c
      
      : sctp: Clean up sctp
      checksumming code) and iii) refactors duplicate checksum code into a
      common function. Tested by myself.
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      4b47bc9a
  3. 28 Sep, 2012 2 commits
    • Jesper Dangaard Brouer's avatar
      ipvs: API change to avoid rescan of IPv6 exthdr · d4383f04
      Jesper Dangaard Brouer authored
      
      
      Reduce the number of times we scan/skip the IPv6 exthdrs.
      
      This patch contains a lot of API changes.  This is done, to avoid
      repeating the scan of finding the IPv6 headers, via ipv6_find_hdr(),
      which is called by ip_vs_fill_iph_skb().
      
      Finding the IPv6 headers is done as early as possible, and passed on
      as a pointer "struct ip_vs_iphdr *" to the affected functions.
      
      This patch reduce/removes 19 calls to ip_vs_fill_iph_skb().
      
      Notice, I have choosen, not to change the API of function
      pointer "(*schedule)" (in struct ip_vs_scheduler) as it can be
      used by external schedulers, via {un,}register_ip_vs_scheduler.
      Only 4 out of 10 schedulers use info from ip_vs_iphdr*, and when
      they do, they are only interested in iph->{s,d}addr.
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      d4383f04
    • Jesper Dangaard Brouer's avatar
      ipvs: Fix faulty IPv6 extension header handling in IPVS · 63dca2c0
      Jesper Dangaard Brouer authored
      IPv6 packets can contain extension headers, thus its wrong to assume
      that the transport/upper-layer header, starts right after (struct
      ipv6hdr) the IPv6 header.  IPVS uses this false assumption, and will
      write SNAT & DNAT modifications at a fixed pos which will corrupt the
      message.
      
      To fix this, proper header position must be found before modifying
      packets.  Introducing ip_vs_fill_iph_skb(), which uses ipv6_find_hdr()
      to skip the exthdrs. It finds (1) the transport header offset, (2) the
      protocol, and (3) detects if the packet is a fragment.
      
      Note, that fragments in IPv6 is represented via an exthdr.  Thus, this
      is detected while skipping through the exthdrs.
      
      This patch depends on commit 84018f55
      
      :
       "netfilter: ip6_tables: add flags parameter to ipv6_find_hdr()"
      This also adds a dependency to ip6_tables.
      
      Originally based on patch from: Hans Schillstrom
      
      kABI notes:
      Changing struct ip_vs_iphdr is a potential minor kABI breaker,
      because external modules can be compiled with another version of
      this struct.  This should not matter, as they would most-likely
      be using a compiled-in version of ip_vs_fill_iphdr().  When
      recompiled, they will notice ip_vs_fill_iphdr() no longer exists,
      and they have to used ip_vs_fill_iph_skb() instead.
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      63dca2c0
  4. 30 Apr, 2012 1 commit
  5. 01 Nov, 2011 1 commit
  6. 31 Mar, 2011 1 commit
  7. 03 Feb, 2011 1 commit
  8. 13 Jan, 2011 7 commits
  9. 25 Nov, 2010 1 commit
    • Hans Schillstrom's avatar
      IPVS: Handle Scheduling errors. · a5959d53
      Hans Schillstrom authored
      
      
      If ip_vs_conn_fill_param_persist return an error to ip_vs_sched_persist,
      this error must propagate as ignored=-1 to ip_vs_schedule().
      Errors from ip_vs_conn_new() in ip_vs_sched_persist() and ip_vs_schedule()
      should also return *ignored=-1;
      
      This patch just relies on the fact that ignored is 1 before calling
      ip_vs_sched_persist().
      
      Sent from Julian:
        "The new case when ip_vs_conn_fill_param_persist fails
         should set *ignored = -1, so that we can use NF_DROP,
         see below. *ignored = -1 should be also used for ip_vs_conn_new
         failure in ip_vs_sched_persist() and ip_vs_schedule().
         The new negative value should be handled in tcp,udp,sctp"
      
      "To summarize:
      
      - *ignored = 1:
            protocol tried to schedule (eg. on SYN), found svc but the
            svc/scheduler decides that this packet should be accepted with
            NF_ACCEPT because it must not be scheduled.
      
      - *ignored = 0:
            scheduler can not find destination, so try bypass or
            return ICMP and then NF_DROP (ip_vs_leave).
      
      - *ignored = -1:
            scheduler tried to schedule but fatal error occurred, eg.
            ip_vs_conn_new failure (ENOMEM) or ip_vs_sip_fill_param
            failure such as missing Call-ID, ENOMEM on skb_linearize
            or pe_data. In this case we should return NF_DROP without
            any attempts to send ICMP with ip_vs_leave."
      
      More or less all ideas and input to this patch is work from
      Julian Anastasov
      Signed-off-by: default avatarHans Schillstrom <hans.schillstrom@ericsson.com>
      Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      a5959d53
  10. 21 Oct, 2010 2 commits
    • Julian Anastasov's avatar
      ipvs: provide address family for debugging · 0d79641a
      Julian Anastasov authored
      
      
       	As skb->protocol is not valid in LOCAL_OUT add
      parameter for address family in packet debugging functions.
      Even if ports are not present in AH and ESP change them to
      use ip_vs_tcpudp_debug_packet to show at least valid addresses
      as before. This patch removes the last user of skb->protocol
      in IPVS.
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      0d79641a
    • Julian Anastasov's avatar
      ipvs: do not schedule conns from real servers · 190ecd27
      Julian Anastasov authored
      
      
       	This patch is needed to avoid scheduling of
      packets from local real server when we add ip_vs_in
      in LOCAL_OUT hook to support local client.
      
       	Currently, when ip_vs_in can not find existing
      connection it tries to create new one by calling ip_vs_schedule.
      
       	The default indication from ip_vs_schedule was if
      connection was scheduled to real server. If real server is
      not available we try to use the bypass forwarding method
      or to send ICMP error. But in some cases we do not want to use
      the bypass feature. So, add flag 'ignored' to indicate if
      the scheduler ignores this packet.
      
       	Make sure we do not create new connections from replies.
      We can hit this problem for persistent services and local real
      server when ip_vs_in is added to LOCAL_OUT hook to handle
      local clients.
      
       	Also, make sure ip_vs_schedule ignores SYN packets
      for Active FTP DATA from local real server. The FTP DATA
      connection should be created on SYN+ACK from client to assign
      correct connection daddr.
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      190ecd27
  11. 05 Oct, 2010 1 commit
  12. 02 Aug, 2010 1 commit
  13. 09 Jul, 2010 1 commit
  14. 18 Feb, 2010 1 commit