diff options
author | Jamal Hadi Salim <hadi@cyberus.ca> | 2005-06-21 16:51:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-21 16:51:04 -0400 |
commit | 0d51aa80a9b1db43920c0770c3bb842dd823c005 (patch) | |
tree | 999b0c5afbbb1f32af07eb2e1cb9e2692f1aa791 /net/ipv6/addrconf.c | |
parent | 19baf839ff4a8daa1f2a7400897094fc18e4f5e9 (diff) |
[IPV6]: V6 route events reported with wrong netlink PID and seq number
Essentially netlink at the moment always reports a pid and sequence of 0
always for v6 route activities.
To understand the repurcassions of this look at:
http://lists.quagga.net/pipermail/quagga-dev/2005-June/003507.html
While fixing this, i took the liberty to resolve the outstanding issue
of IPV6 routes inserted via ioctls to have the correct pids as well.
This patch tries to behave as close as possible to the v4 routes i.e
maintains whatever PID the socket issuing the command owns as opposed to
the process. That made the patch a little bulky.
I have tested against both netlink derived utility to add/del routes as
well as ioctl derived one. The Quagga folks have tested against quagga.
This fixes the problem and so far hasnt been detected to introduce any
new issues.
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 47a30c3188ea..14f5c53235fe 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -695,7 +695,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) | |||
695 | 695 | ||
696 | if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) { | 696 | if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) { |
697 | if (onlink == 0) { | 697 | if (onlink == 0) { |
698 | ip6_del_rt(rt, NULL, NULL); | 698 | ip6_del_rt(rt, NULL, NULL, NULL); |
699 | rt = NULL; | 699 | rt = NULL; |
700 | } else if (!(rt->rt6i_flags & RTF_EXPIRES)) { | 700 | } else if (!(rt->rt6i_flags & RTF_EXPIRES)) { |
701 | rt->rt6i_expires = expires; | 701 | rt->rt6i_expires = expires; |
@@ -1340,7 +1340,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev, | |||
1340 | if (dev->type == ARPHRD_SIT && (dev->flags&IFF_POINTOPOINT)) | 1340 | if (dev->type == ARPHRD_SIT && (dev->flags&IFF_POINTOPOINT)) |
1341 | rtmsg.rtmsg_flags |= RTF_NONEXTHOP; | 1341 | rtmsg.rtmsg_flags |= RTF_NONEXTHOP; |
1342 | 1342 | ||
1343 | ip6_route_add(&rtmsg, NULL, NULL); | 1343 | ip6_route_add(&rtmsg, NULL, NULL, NULL); |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | /* Create "default" multicast route to the interface */ | 1346 | /* Create "default" multicast route to the interface */ |
@@ -1357,7 +1357,7 @@ static void addrconf_add_mroute(struct net_device *dev) | |||
1357 | rtmsg.rtmsg_ifindex = dev->ifindex; | 1357 | rtmsg.rtmsg_ifindex = dev->ifindex; |
1358 | rtmsg.rtmsg_flags = RTF_UP; | 1358 | rtmsg.rtmsg_flags = RTF_UP; |
1359 | rtmsg.rtmsg_type = RTMSG_NEWROUTE; | 1359 | rtmsg.rtmsg_type = RTMSG_NEWROUTE; |
1360 | ip6_route_add(&rtmsg, NULL, NULL); | 1360 | ip6_route_add(&rtmsg, NULL, NULL, NULL); |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | static void sit_route_add(struct net_device *dev) | 1363 | static void sit_route_add(struct net_device *dev) |
@@ -1374,7 +1374,7 @@ static void sit_route_add(struct net_device *dev) | |||
1374 | rtmsg.rtmsg_flags = RTF_UP|RTF_NONEXTHOP; | 1374 | rtmsg.rtmsg_flags = RTF_UP|RTF_NONEXTHOP; |
1375 | rtmsg.rtmsg_ifindex = dev->ifindex; | 1375 | rtmsg.rtmsg_ifindex = dev->ifindex; |
1376 | 1376 | ||
1377 | ip6_route_add(&rtmsg, NULL, NULL); | 1377 | ip6_route_add(&rtmsg, NULL, NULL, NULL); |
1378 | } | 1378 | } |
1379 | 1379 | ||
1380 | static void addrconf_add_lroute(struct net_device *dev) | 1380 | static void addrconf_add_lroute(struct net_device *dev) |
@@ -1467,7 +1467,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) | |||
1467 | if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) { | 1467 | if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) { |
1468 | if (rt->rt6i_flags&RTF_EXPIRES) { | 1468 | if (rt->rt6i_flags&RTF_EXPIRES) { |
1469 | if (valid_lft == 0) { | 1469 | if (valid_lft == 0) { |
1470 | ip6_del_rt(rt, NULL, NULL); | 1470 | ip6_del_rt(rt, NULL, NULL, NULL); |
1471 | rt = NULL; | 1471 | rt = NULL; |
1472 | } else { | 1472 | } else { |
1473 | rt->rt6i_expires = rt_expires; | 1473 | rt->rt6i_expires = rt_expires; |
@@ -3094,7 +3094,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
3094 | switch (event) { | 3094 | switch (event) { |
3095 | case RTM_NEWADDR: | 3095 | case RTM_NEWADDR: |
3096 | dst_hold(&ifp->rt->u.dst); | 3096 | dst_hold(&ifp->rt->u.dst); |
3097 | if (ip6_ins_rt(ifp->rt, NULL, NULL)) | 3097 | if (ip6_ins_rt(ifp->rt, NULL, NULL, NULL)) |
3098 | dst_release(&ifp->rt->u.dst); | 3098 | dst_release(&ifp->rt->u.dst); |
3099 | if (ifp->idev->cnf.forwarding) | 3099 | if (ifp->idev->cnf.forwarding) |
3100 | addrconf_join_anycast(ifp); | 3100 | addrconf_join_anycast(ifp); |
@@ -3104,7 +3104,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
3104 | addrconf_leave_anycast(ifp); | 3104 | addrconf_leave_anycast(ifp); |
3105 | addrconf_leave_solict(ifp->idev, &ifp->addr); | 3105 | addrconf_leave_solict(ifp->idev, &ifp->addr); |
3106 | dst_hold(&ifp->rt->u.dst); | 3106 | dst_hold(&ifp->rt->u.dst); |
3107 | if (ip6_del_rt(ifp->rt, NULL, NULL)) | 3107 | if (ip6_del_rt(ifp->rt, NULL, NULL, NULL)) |
3108 | dst_free(&ifp->rt->u.dst); | 3108 | dst_free(&ifp->rt->u.dst); |
3109 | else | 3109 | else |
3110 | dst_release(&ifp->rt->u.dst); | 3110 | dst_release(&ifp->rt->u.dst); |