During reconfiguration, old and new filter expressions in static routes
are compared using i_same() function. When filter expressions contain
function calls, it is necessary that old filter expressions are the
second argument in i_same(), as it is internally modified by i_same().
Otherwise pointers to old (and freed) data appear in the config
structure.
Thanks to Lennert Buytenhek for tracking and reporting the bug.
static inline int
static_same_rte(struct static_route *x, struct static_route *y)
{
- return static_same_dest(x, y) && i_same(x->cmds, y->cmds);
+ /* Note that i_same() requires arguments in (new, old) order */
+ return static_same_dest(x, y) && i_same(y->cmds, x->cmds);
}