diff options
| author | Eric Dumazet <edumazet@google.com> | 2014-04-15 13:47:15 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-04-15 13:47:15 -0400 |
| commit | aad88724c9d54acb1a9737cb6069d8470fa85f74 (patch) | |
| tree | 78cc7b925f3d05338373898f018892b8f434a948 /net/decnet | |
| parent | b0270e91014dabfceaf37f5b40ad51bbf21a1302 (diff) | |
ipv4: add a sock pointer to dst->output() path.
In the dst->output() path for ipv4, the code assumes the skb it has to
transmit is attached to an inet socket, specifically via
ip_mc_output() : The sk_mc_loop() test triggers a WARN_ON() when the
provider of the packet is an AF_PACKET socket.
The dst->output() method gets an additional 'struct sock *sk'
parameter. This needs a cascade of changes so that this parameter can
be propagated from vxlan to final consumer.
Fixes: 8f646c922d55 ("vxlan: keep original skb ownership")
Reported-by: lucien xin <lucien.xin@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
| -rw-r--r-- | net/decnet/dn_route.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index ce0cbbfe0f43..daccc4a36d80 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
| @@ -752,7 +752,7 @@ static int dn_to_neigh_output(struct sk_buff *skb) | |||
| 752 | return n->output(n, skb); | 752 | return n->output(n, skb); |
| 753 | } | 753 | } |
| 754 | 754 | ||
| 755 | static int dn_output(struct sk_buff *skb) | 755 | static int dn_output(struct sock *sk, struct sk_buff *skb) |
| 756 | { | 756 | { |
| 757 | struct dst_entry *dst = skb_dst(skb); | 757 | struct dst_entry *dst = skb_dst(skb); |
| 758 | struct dn_route *rt = (struct dn_route *)dst; | 758 | struct dn_route *rt = (struct dn_route *)dst; |
| @@ -838,6 +838,18 @@ drop: | |||
| 838 | * Used to catch bugs. This should never normally get | 838 | * Used to catch bugs. This should never normally get |
| 839 | * called. | 839 | * called. |
| 840 | */ | 840 | */ |
| 841 | static int dn_rt_bug_sk(struct sock *sk, struct sk_buff *skb) | ||
| 842 | { | ||
| 843 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | ||
| 844 | |||
| 845 | net_dbg_ratelimited("dn_rt_bug: skb from:%04x to:%04x\n", | ||
| 846 | le16_to_cpu(cb->src), le16_to_cpu(cb->dst)); | ||
| 847 | |||
| 848 | kfree_skb(skb); | ||
| 849 | |||
| 850 | return NET_RX_DROP; | ||
| 851 | } | ||
| 852 | |||
| 841 | static int dn_rt_bug(struct sk_buff *skb) | 853 | static int dn_rt_bug(struct sk_buff *skb) |
| 842 | { | 854 | { |
| 843 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | 855 | struct dn_skb_cb *cb = DN_SKB_CB(skb); |
| @@ -1463,7 +1475,7 @@ make_route: | |||
| 1463 | 1475 | ||
| 1464 | rt->n = neigh; | 1476 | rt->n = neigh; |
| 1465 | rt->dst.lastuse = jiffies; | 1477 | rt->dst.lastuse = jiffies; |
| 1466 | rt->dst.output = dn_rt_bug; | 1478 | rt->dst.output = dn_rt_bug_sk; |
| 1467 | switch (res.type) { | 1479 | switch (res.type) { |
| 1468 | case RTN_UNICAST: | 1480 | case RTN_UNICAST: |
| 1469 | rt->dst.input = dn_forward; | 1481 | rt->dst.input = dn_forward; |
