~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to net/core/dst.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
        dst_init_metrics(dst, dst_default_metrics, true);
172
172
        dst->expires = 0UL;
173
173
        dst->path = dst;
174
 
        dst->neighbour = NULL;
175
 
        dst->hh = NULL;
 
174
        RCU_INIT_POINTER(dst->_neighbour, NULL);
176
175
#ifdef CONFIG_XFRM
177
176
        dst->xfrm = NULL;
178
177
#endif
226
225
{
227
226
        struct dst_entry *child;
228
227
        struct neighbour *neigh;
229
 
        struct hh_cache *hh;
230
228
 
231
229
        smp_rmb();
232
230
 
233
231
again:
234
 
        neigh = dst->neighbour;
235
 
        hh = dst->hh;
 
232
        neigh = rcu_dereference_protected(dst->_neighbour, 1);
236
233
        child = dst->child;
237
234
 
238
 
        dst->hh = NULL;
239
 
        if (hh)
240
 
                hh_cache_put(hh);
241
 
 
242
235
        if (neigh) {
243
 
                dst->neighbour = NULL;
 
236
                RCU_INIT_POINTER(dst->_neighbour, NULL);
244
237
                neigh_release(neigh);
245
238
        }
246
239
 
367
360
        if (!unregister) {
368
361
                dst->input = dst->output = dst_discard;
369
362
        } else {
 
363
                struct neighbour *neigh;
 
364
 
370
365
                dst->dev = dev_net(dst->dev)->loopback_dev;
371
366
                dev_hold(dst->dev);
372
367
                dev_put(dev);
373
 
                if (dst->neighbour && dst->neighbour->dev == dev) {
374
 
                        dst->neighbour->dev = dst->dev;
 
368
                rcu_read_lock();
 
369
                neigh = dst_get_neighbour(dst);
 
370
                if (neigh && neigh->dev == dev) {
 
371
                        neigh->dev = dst->dev;
375
372
                        dev_hold(dst->dev);
376
373
                        dev_put(dev);
377
374
                }
 
375
                rcu_read_unlock();
378
376
        }
379
377
}
380
378