| version 1.118, 2008/12/17 20:51:37 |
version 1.119, 2008/12/21 19:12:43 |
| Line 213 route_output(struct mbuf *m, ...) |
|
| Line 213 route_output(struct mbuf *m, ...) |
|
| struct rtentry *rt = NULL; |
struct rtentry *rt = NULL; |
| struct rtentry *saved_nrt = NULL; |
struct rtentry *saved_nrt = NULL; |
| struct rt_addrinfo info; |
struct rt_addrinfo info; |
| int len, error = 0; |
int len, error = 0, ifa_route = 0; |
| struct ifnet *ifp = NULL; |
struct ifnet *ifp = NULL; |
| struct ifaddr *ifa = NULL; |
struct ifaddr *ifa = NULL, *oifa; |
| struct socket *so; |
struct socket *so; |
| va_list ap; |
va_list ap; |
| sa_family_t family; |
sa_family_t family; |
| Line 292 route_output(struct mbuf *m, ...) |
|
| Line 292 route_output(struct mbuf *m, ...) |
|
| error = rtrequest1(rtm->rtm_type, &info, &saved_nrt); |
error = rtrequest1(rtm->rtm_type, &info, &saved_nrt); |
| if (error == 0) { |
if (error == 0) { |
| (rt = saved_nrt)->rt_refcnt++; |
(rt = saved_nrt)->rt_refcnt++; |
| |
ifa = rt_get_ifa(rt); |
| |
/* |
| |
* If deleting an automatic route, scrub the flag. |
| |
*/ |
| |
if (ifa->ifa_flags & IFA_ROUTE) |
| |
ifa->ifa_flags &= ~IFA_ROUTE; |
| goto report; |
goto report; |
| } |
} |
| break; |
break; |
| Line 409 route_output(struct mbuf *m, ...) |
|
| Line 415 route_output(struct mbuf *m, ...) |
|
| rt_getkey(rt), info.rti_info[RTAX_GATEWAY])))) { |
rt_getkey(rt), info.rti_info[RTAX_GATEWAY])))) { |
| ifp = ifa->ifa_ifp; |
ifp = ifa->ifa_ifp; |
| } |
} |
| |
oifa = rt->rt_ifa; |
| |
if (oifa && oifa->ifa_flags & IFA_ROUTE) { |
| |
/* |
| |
* If changing an automatically added route, |
| |
* remove the flag and store the fact. |
| |
*/ |
| |
oifa->ifa_flags &= ~IFA_ROUTE; |
| |
ifa_route = 1; |
| |
} |
| if (ifa) { |
if (ifa) { |
| struct ifaddr *oifa = rt->rt_ifa; |
|
| if (oifa != ifa) { |
if (oifa != ifa) { |
| if (oifa && oifa->ifa_rtrequest) { |
if (oifa && oifa->ifa_rtrequest) { |
| oifa->ifa_rtrequest(RTM_DELETE, |
oifa->ifa_rtrequest(RTM_DELETE, |
| rt, &info); |
rt, &info); |
| } |
} |
| |
/* |
| |
* If changing an automatically added |
| |
* route, store this if not static. |
| |
*/ |
| |
if (ifa_route && |
| |
!(rt->rt_flags & RTF_STATIC)) |
| |
ifa->ifa_flags |= IFA_ROUTE; |
| rt_replace_ifa(rt, ifa); |
rt_replace_ifa(rt, ifa); |
| rt->rt_ifp = ifp; |
rt->rt_ifp = ifp; |
| } |
} |