diff options
Diffstat (limited to 'net/ipv4/xfrm4_policy.c')
-rw-r--r-- | net/ipv4/xfrm4_policy.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 4464f3bff6a7..dd1fd8c473fc 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
@@ -80,10 +80,6 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, | |||
80 | xdst->u.dst.dev = dev; | 80 | xdst->u.dst.dev = dev; |
81 | dev_hold(dev); | 81 | dev_hold(dev); |
82 | 82 | ||
83 | xdst->u.rt.idev = in_dev_get(dev); | ||
84 | if (!xdst->u.rt.idev) | ||
85 | return -ENODEV; | ||
86 | |||
87 | xdst->u.rt.peer = rt->peer; | 83 | xdst->u.rt.peer = rt->peer; |
88 | if (rt->peer) | 84 | if (rt->peer) |
89 | atomic_inc(&rt->peer->refcnt); | 85 | atomic_inc(&rt->peer->refcnt); |
@@ -189,8 +185,6 @@ static void xfrm4_dst_destroy(struct dst_entry *dst) | |||
189 | { | 185 | { |
190 | struct xfrm_dst *xdst = (struct xfrm_dst *)dst; | 186 | struct xfrm_dst *xdst = (struct xfrm_dst *)dst; |
191 | 187 | ||
192 | if (likely(xdst->u.rt.idev)) | ||
193 | in_dev_put(xdst->u.rt.idev); | ||
194 | if (likely(xdst->u.rt.peer)) | 188 | if (likely(xdst->u.rt.peer)) |
195 | inet_putpeer(xdst->u.rt.peer); | 189 | inet_putpeer(xdst->u.rt.peer); |
196 | xfrm_dst_destroy(xdst); | 190 | xfrm_dst_destroy(xdst); |
@@ -199,27 +193,9 @@ static void xfrm4_dst_destroy(struct dst_entry *dst) | |||
199 | static void xfrm4_dst_ifdown(struct dst_entry *dst, struct net_device *dev, | 193 | static void xfrm4_dst_ifdown(struct dst_entry *dst, struct net_device *dev, |
200 | int unregister) | 194 | int unregister) |
201 | { | 195 | { |
202 | struct xfrm_dst *xdst; | ||
203 | |||
204 | if (!unregister) | 196 | if (!unregister) |
205 | return; | 197 | return; |
206 | 198 | ||
207 | xdst = (struct xfrm_dst *)dst; | ||
208 | if (xdst->u.rt.idev->dev == dev) { | ||
209 | struct in_device *loopback_idev = | ||
210 | in_dev_get(dev_net(dev)->loopback_dev); | ||
211 | BUG_ON(!loopback_idev); | ||
212 | |||
213 | do { | ||
214 | in_dev_put(xdst->u.rt.idev); | ||
215 | xdst->u.rt.idev = loopback_idev; | ||
216 | in_dev_hold(loopback_idev); | ||
217 | xdst = (struct xfrm_dst *)xdst->u.dst.child; | ||
218 | } while (xdst->u.dst.xfrm); | ||
219 | |||
220 | __in_dev_put(loopback_idev); | ||
221 | } | ||
222 | |||
223 | xfrm_dst_ifdown(dst, dev); | 199 | xfrm_dst_ifdown(dst, dev); |
224 | } | 200 | } |
225 | 201 | ||