Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105226948
D36170.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36170.diff
View Options
Index: sys/nfs/bootp_subr.c
===================================================================
--- sys/nfs/bootp_subr.c
+++ sys/nfs/bootp_subr.c
@@ -977,25 +977,14 @@
static void
bootpc_add_default_route(struct bootpc_ifcontext *ifctx)
{
+ struct rib_cmd_info rc = {};
int error;
- struct sockaddr_in defdst;
- struct sockaddr_in defmask;
- struct rt_addrinfo info;
- struct rib_cmd_info rc;
if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY))
return;
- clear_sinaddr(&defdst);
- clear_sinaddr(&defmask);
-
- bzero((caddr_t)&info, sizeof(info));
- info.rti_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
- info.rti_info[RTAX_DST] = (struct sockaddr *)&defdst;
- info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&defmask;
- info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ifctx->gw;
-
- error = rib_action(RT_DEFAULT_FIB, RTM_ADD, &info, &rc);
+ error = rib_add_default_route(RT_DEFAULT_FIB, AF_INET,
+ ifctx->ifp, (struct sockaddr *)&ifctx->gw, &rc);
if (error != 0) {
printf("%s: RTM_ADD, error=%d\n", __func__, error);
@@ -1006,24 +995,16 @@
bootpc_remove_default_route(struct bootpc_ifcontext *ifctx)
{
int error;
- struct sockaddr_in defdst;
- struct sockaddr_in defmask;
- struct rt_addrinfo info;
+ struct sockaddr_in dst;
struct rib_cmd_info rc;
if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY))
return;
- clear_sinaddr(&defdst);
- clear_sinaddr(&defmask);
-
- bzero((caddr_t)&info, sizeof(info));
- info.rti_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
- info.rti_info[RTAX_DST] = (struct sockaddr *)&defdst;
- info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&defmask;
- info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ifctx->gw;
+ clear_sinaddr(&dst);
- error = rib_action(RT_DEFAULT_FIB, RTM_DELETE, &info, &rc);
+ error = rib_del_route_px(RT_DEFAULT_FIB, (struct sockaddr *)&dst, 0,
+ rib_match_gw, (struct sockaddr *)&ifctx->gw, 0, &rc);
if (error != 0) {
printf("%s: RTM_DELETE, error=%d\n", __func__, error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 14, 7:03 PM (8 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15393350
Default Alt Text
D36170.diff (1 KB)
Attached To
Mode
D36170: routing: make bootp code use new nhop-based KPI.
Attached
Detach File
Event Timeline
Log In to Comment