Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111999
b: refs/heads/master
c: 86b08d8
h: refs/heads/master
i:
  111997: 62c4194
  111995: 54fab92
  111991: 0b022cd
  111983: 7d7dee9
  111967: fefb983
  111935: 625964b
  111871: 89e0241
v: v3
  • Loading branch information
KOVACS Krisztian authored and David S. Miller committed Oct 1, 2008
1 parent ca8bf72 commit c29606f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88ef4a5a78e63420dd1dd770f1bd1dc198926b04
refs/heads/master: 86b08d867d7de001ab224180ed7865fab93fd56e
6 changes: 6 additions & 0 deletions trunk/include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <net/inet_sock.h>
#include <net/snmp.h>
#include <net/flow.h>

struct sock;

Expand Down Expand Up @@ -149,6 +150,11 @@ struct ip_reply_arg {

#define IP_REPLY_ARG_NOSRCCHECK 1

static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
{
return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0;
}

void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
unsigned int len);

Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/inet_connection_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ struct dst_entry* inet_csk_route_req(struct sock *sk,
.saddr = ireq->loc_addr,
.tos = RT_CONN_FLAGS(sk) } },
.proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports =
{ .sport = inet_sk(sk)->sport,
.dport = ireq->rmt_port } } };
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
.saddr = inet->saddr,
.tos = RT_CONN_FLAGS(sk) } },
.proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports =
{ .sport = inet->sport,
.dport = inet->dport } } };
Expand Down Expand Up @@ -1371,7 +1372,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
.uli_u = { .ports =
{ .sport = tcp_hdr(skb)->dest,
.dport = tcp_hdr(skb)->source } },
.proto = sk->sk_protocol };
.proto = sk->sk_protocol,
.flags = ip_reply_arg_flowi_flags(arg) };
security_skb_classify_flow(skb, &fl);
if (ip_route_output_key(sock_net(sk), &rt, &fl))
return;
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/ipv4/netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
unsigned int type;

type = inet_addr_type(&init_net, iph->saddr);
if (skb->sk && inet_sk(skb->sk)->transparent)
type = RTN_LOCAL;
if (addr_type == RTN_UNSPEC)
addr_type = type;

Expand All @@ -33,6 +35,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
fl.nl_u.ip4_u.tos = RT_TOS(iph->tos);
fl.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
fl.mark = skb->mark;
fl.flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0;
if (ip_route_output_key(&init_net, &rt, &fl) != 0)
return -1;

Expand Down
2 changes: 2 additions & 0 deletions trunk/net/ipv4/syncookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/cryptohash.h>
#include <linux/kernel.h>
#include <net/tcp.h>
#include <net/route.h>

/* Timestamps: lowest 9 bits store TCP options */
#define TSBITS 9
Expand Down Expand Up @@ -337,6 +338,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
.saddr = ireq->loc_addr,
.tos = RT_CONN_FLAGS(sk) } },
.proto = IPPROTO_TCP,
.flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports =
{ .sport = th->dest,
.dport = th->source } } };
Expand Down

0 comments on commit c29606f

Please sign in to comment.