diff options
author | Milan Kocian <milon@wq.cz> | 2007-05-23 17:55:06 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-24 19:36:53 -0400 |
commit | b8f558313506b5bc435f2e031f3bec4b1725098e (patch) | |
tree | e82ba2864feff645abfd31ac49b3c235e48ded3d /net | |
parent | 8a903be129a741fd1e1d44223f0e3a01c357bde5 (diff) |
[RTNETLINK]: Fix sending netlink message when replace route.
When you replace route via ip r r command the netlink multicast message is
not send. This patch corrects it. NL message is sent with NLM_F_REPLACE
flag.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=8320
Signed-off-by: Milan Kocian <milon@wq.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/fib_hash.c | 6 | ||||
-rw-r--r-- | net/ipv4/fib_lookup.h | 3 | ||||
-rw-r--r-- | net/ipv4/fib_semantics.c | 5 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 6 |
4 files changed, 13 insertions, 7 deletions
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 9cfecf1215c9..07e843a47dde 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
@@ -456,6 +456,8 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
456 | fib_release_info(fi_drop); | 456 | fib_release_info(fi_drop); |
457 | if (state & FA_S_ACCESSED) | 457 | if (state & FA_S_ACCESSED) |
458 | rt_cache_flush(-1); | 458 | rt_cache_flush(-1); |
459 | rtmsg_fib(RTM_NEWROUTE, key, fa, cfg->fc_dst_len, tb->tb_id, | ||
460 | &cfg->fc_nlinfo, NLM_F_REPLACE); | ||
459 | return 0; | 461 | return 0; |
460 | } | 462 | } |
461 | 463 | ||
@@ -523,7 +525,7 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
523 | rt_cache_flush(-1); | 525 | rt_cache_flush(-1); |
524 | 526 | ||
525 | rtmsg_fib(RTM_NEWROUTE, key, new_fa, cfg->fc_dst_len, tb->tb_id, | 527 | rtmsg_fib(RTM_NEWROUTE, key, new_fa, cfg->fc_dst_len, tb->tb_id, |
526 | &cfg->fc_nlinfo); | 528 | &cfg->fc_nlinfo, 0); |
527 | return 0; | 529 | return 0; |
528 | 530 | ||
529 | out_free_new_fa: | 531 | out_free_new_fa: |
@@ -589,7 +591,7 @@ static int fn_hash_delete(struct fib_table *tb, struct fib_config *cfg) | |||
589 | 591 | ||
590 | fa = fa_to_delete; | 592 | fa = fa_to_delete; |
591 | rtmsg_fib(RTM_DELROUTE, key, fa, cfg->fc_dst_len, | 593 | rtmsg_fib(RTM_DELROUTE, key, fa, cfg->fc_dst_len, |
592 | tb->tb_id, &cfg->fc_nlinfo); | 594 | tb->tb_id, &cfg->fc_nlinfo, 0); |
593 | 595 | ||
594 | kill_fn = 0; | 596 | kill_fn = 0; |
595 | write_lock_bh(&fib_hash_lock); | 597 | write_lock_bh(&fib_hash_lock); |
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h index 0e8b70bad4e1..eef9eec17e0c 100644 --- a/net/ipv4/fib_lookup.h +++ b/net/ipv4/fib_lookup.h | |||
@@ -30,7 +30,8 @@ extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | |||
30 | int dst_len, u8 tos, struct fib_info *fi, | 30 | int dst_len, u8 tos, struct fib_info *fi, |
31 | unsigned int); | 31 | unsigned int); |
32 | extern void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, | 32 | extern void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, |
33 | int dst_len, u32 tb_id, struct nl_info *info); | 33 | int dst_len, u32 tb_id, struct nl_info *info, |
34 | unsigned int nlm_flags); | ||
34 | extern struct fib_alias *fib_find_alias(struct list_head *fah, | 35 | extern struct fib_alias *fib_find_alias(struct list_head *fah, |
35 | u8 tos, u32 prio); | 36 | u8 tos, u32 prio); |
36 | extern int fib_detect_death(struct fib_info *fi, int order, | 37 | extern int fib_detect_death(struct fib_info *fi, int order, |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 406ea7050aed..bb94550d95c3 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -301,7 +301,8 @@ static inline size_t fib_nlmsg_size(struct fib_info *fi) | |||
301 | } | 301 | } |
302 | 302 | ||
303 | void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, | 303 | void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, |
304 | int dst_len, u32 tb_id, struct nl_info *info) | 304 | int dst_len, u32 tb_id, struct nl_info *info, |
305 | unsigned int nlm_flags) | ||
305 | { | 306 | { |
306 | struct sk_buff *skb; | 307 | struct sk_buff *skb; |
307 | u32 seq = info->nlh ? info->nlh->nlmsg_seq : 0; | 308 | u32 seq = info->nlh ? info->nlh->nlmsg_seq : 0; |
@@ -313,7 +314,7 @@ void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, | |||
313 | 314 | ||
314 | err = fib_dump_info(skb, info->pid, seq, event, tb_id, | 315 | err = fib_dump_info(skb, info->pid, seq, event, tb_id, |
315 | fa->fa_type, fa->fa_scope, key, dst_len, | 316 | fa->fa_type, fa->fa_scope, key, dst_len, |
316 | fa->fa_tos, fa->fa_info, 0); | 317 | fa->fa_tos, fa->fa_info, nlm_flags); |
317 | if (err < 0) { | 318 | if (err < 0) { |
318 | /* -EMSGSIZE implies BUG in fib_nlmsg_size() */ | 319 | /* -EMSGSIZE implies BUG in fib_nlmsg_size() */ |
319 | WARN_ON(err == -EMSGSIZE); | 320 | WARN_ON(err == -EMSGSIZE); |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 9be7da7c3a8f..30e332ade61b 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1226,6 +1226,8 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg) | |||
1226 | fib_release_info(fi_drop); | 1226 | fib_release_info(fi_drop); |
1227 | if (state & FA_S_ACCESSED) | 1227 | if (state & FA_S_ACCESSED) |
1228 | rt_cache_flush(-1); | 1228 | rt_cache_flush(-1); |
1229 | rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, | ||
1230 | tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE); | ||
1229 | 1231 | ||
1230 | goto succeeded; | 1232 | goto succeeded; |
1231 | } | 1233 | } |
@@ -1278,7 +1280,7 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg) | |||
1278 | 1280 | ||
1279 | rt_cache_flush(-1); | 1281 | rt_cache_flush(-1); |
1280 | rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id, | 1282 | rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id, |
1281 | &cfg->fc_nlinfo); | 1283 | &cfg->fc_nlinfo, 0); |
1282 | succeeded: | 1284 | succeeded: |
1283 | return 0; | 1285 | return 0; |
1284 | 1286 | ||
@@ -1624,7 +1626,7 @@ static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg) | |||
1624 | 1626 | ||
1625 | fa = fa_to_delete; | 1627 | fa = fa_to_delete; |
1626 | rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id, | 1628 | rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id, |
1627 | &cfg->fc_nlinfo); | 1629 | &cfg->fc_nlinfo, 0); |
1628 | 1630 | ||
1629 | l = fib_find_node(t, key); | 1631 | l = fib_find_node(t, key); |
1630 | li = find_leaf_info(l, plen); | 1632 | li = find_leaf_info(l, plen); |