• J
    ipvs: changes for local real server · fc604767
    Julian Anastasov 提交于
     	This patch deals with local real servers:
    
    - Add support for DNAT to local address (different real server port).
    It needs ip_vs_out hook in LOCAL_OUT for both families because
    skb->protocol is not set for locally generated packets and can not
    be used to set 'af'.
    
    - Skip packets in ip_vs_in marked with skb->ipvs_property because
    ip_vs_out processing can be executed in LOCAL_OUT but we still
    have the conn_out_get check in ip_vs_in.
    
    - Ignore packets with inet->nodefrag from local stack
    
    - Require skb_dst(skb) != NULL because we use it to get struct net
    
    - Add support for changing the route to local IPv4 stack after DNAT
    depending on the source address type. Local client sets output
    route and the remote client sets input route. It looks like
    IPv6 does not need such rerouting because the replies use
    addresses from initial incoming header, not from skb route.
    
    - All transmitters now have strict checks for the destination
    address type: redirect from non-local address to local real
    server requires NAT method, local address can not be used as
    source address when talking to remote real server.
    
    - Now LOCALNODE is not set explicitly as forwarding
    method in real server to allow the connections to provide
    correct forwarding method to the backup server. Not sure if
    this breaks tools that expect to see 'Local' real server type.
    If needed, this can be supported with new flag IP_VS_DEST_F_LOCAL.
    Now it should be possible connections in backup that lost
    their fwmark information during sync to be forwarded properly
    to their daddr, even if it is local address in the backup server.
    By this way backup could be used as real server for DR or TUN,
    for NAT there are some restrictions because tuple collisions
    in conntracks can create problems for the traffic.
    
    - Call ip_vs_dst_reset when destination is updated in case
    some real server IP type is changed between local and remote.
    
    [ horms@verge.net.au: removed trailing whitespace ]
    Signed-off-by: NJulian Anastasov <ja@ssi.bg>
    Signed-off-by: NSimon Horman <horms@verge.net.au>
    fc604767
ip_vs.h 31.1 KB