| .. | .. |
|---|
| 7 | 7 | #include <net/net_namespace.h> |
|---|
| 8 | 8 | #include <net/sock.h> |
|---|
| 9 | 9 | #include <net/fib_notifier.h> |
|---|
| 10 | +#include <net/ip_fib.h> |
|---|
| 10 | 11 | |
|---|
| 11 | 12 | /** |
|---|
| 12 | 13 | * struct vif_device - interface representor for multicast routing |
|---|
| .. | .. |
|---|
| 46 | 47 | }; |
|---|
| 47 | 48 | |
|---|
| 48 | 49 | static inline int mr_call_vif_notifier(struct notifier_block *nb, |
|---|
| 49 | | - struct net *net, |
|---|
| 50 | 50 | unsigned short family, |
|---|
| 51 | 51 | enum fib_event_type event_type, |
|---|
| 52 | 52 | struct vif_device *vif, |
|---|
| 53 | | - unsigned short vif_index, u32 tb_id) |
|---|
| 53 | + unsigned short vif_index, u32 tb_id, |
|---|
| 54 | + struct netlink_ext_ack *extack) |
|---|
| 54 | 55 | { |
|---|
| 55 | 56 | struct vif_entry_notifier_info info = { |
|---|
| 56 | 57 | .info = { |
|---|
| 57 | 58 | .family = family, |
|---|
| 58 | | - .net = net, |
|---|
| 59 | + .extack = extack, |
|---|
| 59 | 60 | }, |
|---|
| 60 | 61 | .dev = vif->dev, |
|---|
| 61 | 62 | .vif_index = vif_index, |
|---|
| .. | .. |
|---|
| 63 | 64 | .tb_id = tb_id, |
|---|
| 64 | 65 | }; |
|---|
| 65 | 66 | |
|---|
| 66 | | - return call_fib_notifier(nb, net, event_type, &info.info); |
|---|
| 67 | + return call_fib_notifier(nb, event_type, &info.info); |
|---|
| 67 | 68 | } |
|---|
| 68 | 69 | |
|---|
| 69 | 70 | static inline int mr_call_vif_notifiers(struct net *net, |
|---|
| .. | .. |
|---|
| 76 | 77 | struct vif_entry_notifier_info info = { |
|---|
| 77 | 78 | .info = { |
|---|
| 78 | 79 | .family = family, |
|---|
| 79 | | - .net = net, |
|---|
| 80 | 80 | }, |
|---|
| 81 | 81 | .dev = vif->dev, |
|---|
| 82 | 82 | .vif_index = vif_index, |
|---|
| .. | .. |
|---|
| 172 | 172 | }; |
|---|
| 173 | 173 | |
|---|
| 174 | 174 | static inline int mr_call_mfc_notifier(struct notifier_block *nb, |
|---|
| 175 | | - struct net *net, |
|---|
| 176 | 175 | unsigned short family, |
|---|
| 177 | 176 | enum fib_event_type event_type, |
|---|
| 178 | | - struct mr_mfc *mfc, u32 tb_id) |
|---|
| 177 | + struct mr_mfc *mfc, u32 tb_id, |
|---|
| 178 | + struct netlink_ext_ack *extack) |
|---|
| 179 | 179 | { |
|---|
| 180 | 180 | struct mfc_entry_notifier_info info = { |
|---|
| 181 | 181 | .info = { |
|---|
| 182 | 182 | .family = family, |
|---|
| 183 | | - .net = net, |
|---|
| 183 | + .extack = extack, |
|---|
| 184 | 184 | }, |
|---|
| 185 | 185 | .mfc = mfc, |
|---|
| 186 | 186 | .tb_id = tb_id |
|---|
| 187 | 187 | }; |
|---|
| 188 | 188 | |
|---|
| 189 | | - return call_fib_notifier(nb, net, event_type, &info.info); |
|---|
| 189 | + return call_fib_notifier(nb, event_type, &info.info); |
|---|
| 190 | 190 | } |
|---|
| 191 | 191 | |
|---|
| 192 | 192 | static inline int mr_call_mfc_notifiers(struct net *net, |
|---|
| .. | .. |
|---|
| 198 | 198 | struct mfc_entry_notifier_info info = { |
|---|
| 199 | 199 | .info = { |
|---|
| 200 | 200 | .family = family, |
|---|
| 201 | | - .net = net, |
|---|
| 202 | 201 | }, |
|---|
| 203 | 202 | .mfc = mfc, |
|---|
| 204 | 203 | .tb_id = tb_id |
|---|
| .. | .. |
|---|
| 283 | 282 | |
|---|
| 284 | 283 | int mr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, |
|---|
| 285 | 284 | struct mr_mfc *c, struct rtmsg *rtm); |
|---|
| 285 | +int mr_table_dump(struct mr_table *mrt, struct sk_buff *skb, |
|---|
| 286 | + struct netlink_callback *cb, |
|---|
| 287 | + int (*fill)(struct mr_table *mrt, struct sk_buff *skb, |
|---|
| 288 | + u32 portid, u32 seq, struct mr_mfc *c, |
|---|
| 289 | + int cmd, int flags), |
|---|
| 290 | + spinlock_t *lock, struct fib_dump_filter *filter); |
|---|
| 286 | 291 | int mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb, |
|---|
| 287 | 292 | struct mr_table *(*iter)(struct net *net, |
|---|
| 288 | 293 | struct mr_table *mrt), |
|---|
| .. | .. |
|---|
| 290 | 295 | struct sk_buff *skb, |
|---|
| 291 | 296 | u32 portid, u32 seq, struct mr_mfc *c, |
|---|
| 292 | 297 | int cmd, int flags), |
|---|
| 293 | | - spinlock_t *lock); |
|---|
| 298 | + spinlock_t *lock, struct fib_dump_filter *filter); |
|---|
| 294 | 299 | |
|---|
| 295 | 300 | int mr_dump(struct net *net, struct notifier_block *nb, unsigned short family, |
|---|
| 296 | 301 | int (*rules_dump)(struct net *net, |
|---|
| 297 | | - struct notifier_block *nb), |
|---|
| 302 | + struct notifier_block *nb, |
|---|
| 303 | + struct netlink_ext_ack *extack), |
|---|
| 298 | 304 | struct mr_table *(*mr_iter)(struct net *net, |
|---|
| 299 | 305 | struct mr_table *mrt), |
|---|
| 300 | | - rwlock_t *mrt_lock); |
|---|
| 306 | + rwlock_t *mrt_lock, struct netlink_ext_ack *extack); |
|---|
| 301 | 307 | #else |
|---|
| 302 | 308 | static inline void vif_device_init(struct vif_device *v, |
|---|
| 303 | 309 | struct net_device *dev, |
|---|
| .. | .. |
|---|
| 340 | 346 | struct sk_buff *skb, |
|---|
| 341 | 347 | u32 portid, u32 seq, struct mr_mfc *c, |
|---|
| 342 | 348 | int cmd, int flags), |
|---|
| 343 | | - spinlock_t *lock) |
|---|
| 349 | + spinlock_t *lock, struct fib_dump_filter *filter) |
|---|
| 344 | 350 | { |
|---|
| 345 | 351 | return -EINVAL; |
|---|
| 346 | 352 | } |
|---|
| .. | .. |
|---|
| 348 | 354 | static inline int mr_dump(struct net *net, struct notifier_block *nb, |
|---|
| 349 | 355 | unsigned short family, |
|---|
| 350 | 356 | int (*rules_dump)(struct net *net, |
|---|
| 351 | | - struct notifier_block *nb), |
|---|
| 357 | + struct notifier_block *nb, |
|---|
| 358 | + struct netlink_ext_ack *extack), |
|---|
| 352 | 359 | struct mr_table *(*mr_iter)(struct net *net, |
|---|
| 353 | 360 | struct mr_table *mrt), |
|---|
| 354 | | - rwlock_t *mrt_lock) |
|---|
| 361 | + rwlock_t *mrt_lock, struct netlink_ext_ack *extack) |
|---|
| 355 | 362 | { |
|---|
| 356 | 363 | return -EINVAL; |
|---|
| 357 | 364 | } |
|---|